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.
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
Performance improvements! #192
Performance improvements! #192
Changes from 1 commit
b6aa5a7
95e4bc8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Let's add a comment to summarize our findings from yesterdays quick benchmarking session and why we're going with the replace variant again.
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.
I've always felt that this change was suspicious and could be the root cause of the performance issues I reported previously for versions after 5.1.2.
I plan to deploy a test release next Monday and roll back this part of the change separately from the 5.1.16 version of the code to see if there are still performance issues.
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.
FYI https://jsben.ch/hR6XD

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.
@JimLiu - that benchmark website produces statistically meaningless results. It's not open source (which is a problem), but I looked at the implementation and it's effectively running benchmarks in a tight loop:
while(performance.now()-start < 5000) test()
. This makes the order of benchmarks matter, and allows the JS VM to perform cross-benchmark optimizations that can only happen in the specific case ofwhile(1) test()
and never in real code.The only current benchmarking website that produces statistically meaningful results is ESbench (disclaimer: I maintain it). The reason for this is because it uses the same Benchmark.js (the library that powered JSPerf, built by Matthias Bynens from the V8 team). Benchmark.js performs JIT warmup runs, encapsulates benchmarks in functions that prevent synthetic VM optimizations (like hoisting/inlining of benchmark code), and returns median values with standard deviation.
Here's the benchmarks we use for
encodeEntities
on ESBench:https://esbench.com/bench/5f88af6cb4632100a7dcd414