forked from redfin/react-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Front load and cache some page chain class prep
This takes some work that used to happen for each request and caches it. This is mostly groundwork for fine-grained instrumentation of page lifecycle methods. It incidentally also slightly reduces the overhead of building up the page chain object during each request. [core/__bench__/handlePage.js](redfin#926) before: ``` 1 0.000481308279135711 10 0.0009405891195623999 100 0.005067864883424908 1000 0.04754033069230767 ``` [core/__bench__/handlePage.js](redfin#926) after: ``` 1 0.0004272630582241284 10 0.0006927164659505115 100 0.0034683026867557273 1000 0.031324801985714294 ``` Basically reduces middleware overhead to from ~50µs to ~30µs. Not a huge deal, but the instrumentation is likely to add a little overhead, so it's nice to pay some of that down ahead of time. 😁
- Loading branch information
Showing
3 changed files
with
81 additions
and
64 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
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