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
During our investigations trying to optimize Kibana's startup time, we discovered that the perf impact of using require-in-the-middle was depending on the number of Hook that were defined. (More details in elastic/kibana#178285, but we're talking about ~20% performance gain in total module load time by using only one hook instead of 5)
The implementation of RITM seems to confirm it, given each instance of Hook is patching Module.prototype.require, therefor patching the already-patched require from the previous Hook.
I would expect the library to perform the patching only once, and handle all the registered hooks from this single patched method. It would avoid the interception logic to be executed each time for each hook, for each import.
The text was updated successfully, but these errors were encountered:
I would expect the library to perform the patching only once, and handle all the registered hooks from this single patched method. It would avoid the interception logic to be executed each time for each hook, for each import.
During our investigations trying to optimize Kibana's startup time, we discovered that the perf impact of using
require-in-the-middle
was depending on the number ofHook
that were defined. (More details in elastic/kibana#178285, but we're talking about ~20% performance gain in total module load time by using only one hook instead of 5)The implementation of RITM seems to confirm it, given each instance of
Hook
is patchingModule.prototype.require
, therefor patching the already-patched require from the previous Hook.I would expect the library to perform the patching only once, and handle all the registered hooks from this single patched method. It would avoid the interception logic to be executed each time for each hook, for each import.
The text was updated successfully, but these errors were encountered: