Performance: Cache obj[key] access into #707
Merged
mcollina merged 1 commit intofastify:masterfrom Apr 11, 2024
Merged
Conversation
Cache into a variable the object[key] value Signed-off-by: francesco <francesco.bagnoli.69@gmail.com>
Member
|
it does not seem there are any improvements, or I'm misreading this? |
Contributor
|
The problem with micro-optimization is the instability of the benchmark. The PR is correct, but the difference is negligible. Tomorrow try to run benchmark on thousands of samples (now is 100) |
Contributor
Author
|
@mcollina results on 250 minSamples (default is 100): Master |
Member
|
It seems you are cutting out all the object benchmarks? I thought this impacted those. |
Contributor
Author
@mcollina minSamples 500 PR Master |
ivan-tymoshenko
approved these changes
Apr 11, 2024
2 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caching the value of
obj[key]into a variable instead of continue access to objectPR
master
Checklist
npm run testandnpm run benchmarkand the Code of conduct