Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front load and cache some page chain class prep #928

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gigabo
Copy link
Contributor

@gigabo gigabo commented Apr 11, 2017

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 before:

1       0.000481308279135711
10      0.0009405891195623999
100     0.005067864883424908
1000    0.04754033069230767

core/__bench__/handlePage.js 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. 😁

@gigabo
Copy link
Contributor Author

gigabo commented Apr 11, 2017

Ugh, no idea why those zombie tests are failing. Everything looks good browser-side in react-server-test-pages and react-server-website. :hurtrealbad:

emecell added a commit to emecell/react-server that referenced this pull request Jan 17, 2018
Relates to redfin#928 but adds in clean up work for the TransitionPage used in tests.
emecell added a commit to emecell/react-server that referenced this pull request Jan 17, 2018
Relates to redfin#928 but adds in clean up work for the TransitionPage used in tests.
emecell added a commit to emecell/react-server that referenced this pull request Jan 17, 2018
Relates to redfin#928 but adds in clean up work for the TransitionPage used in tests.
gigabo and others added 2 commits January 17, 2018 00:30
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. 😁
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants