-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin: Optimize module hooks by caching the functions called for each.
... or is it? There has always been a measurable performance drop caused by iterating through the whole list of functions and comparing each and every function name. With the "thread_exit" function, this has become even worse. Building a JSON array of function pointer for each hook in advance removes this drop. Thanks to Jansson's reference counting, this even comes at no additional cost in memory (as if that ever mattered). And as a side effect, this also guarantees that the execution order in mod_func_run() at least follows the order of DLL loading, even though the order of functions *inside* a DLL remains undefined.
- Loading branch information
Showing
2 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters