You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say my application is a concurrent application and the hook implementation is applied to a great amount of data, which means it would be executed thousands of times.
So, how much is the wrapping work by pluggy affect the execution time?
I red the code and saw there is a relatively long chain from pm.hook.method() calling to the actual implementation.
Below is my summary of the calling chain:
From pm.hook.method which is actually a _HookRelay instance to
-> _HookCaller.__call__
-> PluginManager._hookexec
-> PluginManager._inner_hookexec
-> _multicall in callers.py
-> HookImpl.funcion is the actual hook implmentation
The text was updated successfully, but these errors were encountered:
nnop
changed the title
How much would the hook wrapping affect the execution time of the hook implementation?
How much would the hook wrapping affect the execution time?
May 29, 2019
Say my application is a concurrent application and the hook implementation is applied to a great amount of data, which means it would be executed thousands of times.
@nnop this is a very good question and probably a use case we could attempt to optimize for if there was a demonstrable application.
So, how much is the wrapping work by pluggy affect the execution time?
I think you've mostly figured out the call stack minus the detail that _multicall of course invokes n hook implementations (depending on what's registered at call time) and any wrappers that intercept each hook call.
In terms of minimizing the current (what, four?) extra function calls I know I've contemplated removing ._inner_hookexec since it's only used for tracing which I'm not even sure is used that much as a feature (though I'd have to let consumer project maintainers chime in).
If you want to do some further digging (and we'd appreciate the help) there's a little benchmark test suite that you can play with to try and expose bottlenecks for your use case.
Say my application is a concurrent application and the hook implementation is applied to a great amount of data, which means it would be executed thousands of times.
So, how much is the wrapping work by
pluggy
affect the execution time?I red the code and saw there is a relatively long chain from
pm.hook.method()
calling to the actual implementation.Below is my summary of the calling chain:
From
pm.hook.method
which is actually a_HookRelay
instance to->
_HookCaller.__call__
->
PluginManager._hookexec
->
PluginManager._inner_hookexec
->
_multicall
incallers.py
->
HookImpl.funcion
is the actual hook implmentationThe text was updated successfully, but these errors were encountered: