-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
perf: cache layout access check #414
perf: cache layout access check #414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Can you replace hashlru with toad-cache (LruMap) in another PR? We try to use that for all the packages now, unless there is a significant perf regression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, just checked the PR again and it looks to me like this function gets called once?
Is that not the case?
It gets called a single time for a globally defined layout. It gets called on every request (via
|
Marked as draft to let #416 and the subsequent |
07e87e0
to
e13dbd0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Specifying a layout on render causes a synchronous
fs.accessSync
on every request. Cache the result of these lookups in LRU to avoid duplicate blocking checks.Benchmarks (master)
Benchmarks (PR)
Checklist
npm run test
andnpm run benchmark
and the Code of conduct