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
## Details
Additional changes made with the goal of reducing the startup time of
this plugin. The main idea in this set of changes is to avoid requiring
modules at the top of files until they are actually needed. To
accomplish this we have:
- gone back to storing global information in the `state` module, that
way we are not calling `setup` in order to provide data to various
modules that need it, instead they will go back to picking it up from
`state` fields that are shared, has some drawbacks but overall fine
- for various one off `require` statements (i.e. only used once in a
given module) inline the `require` statement within the function that
uses it, particularly helpful with the request `Context` fields and
running `handlers`
Overall the improvement seems to be around 2x, give or take. Where
previously we were starting up in around 3.0ms, it is now closer to
1.5ms, which is a nice bump.
Most of the remaining time is spent loading the large `settings` module,
and the impact of all the things we do need to load immediately, times
are around 0.5ms and 1.0ms respectively.
0 commit comments