GeezerVison is showing github.com — util: improve text-decoder performance by anonrig · Pull Request #45363 · nodejs/node
Conversation
anonrig
commented
Nov 7, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This pull request fixes previous benchmarks, improves it, and later improves the performance of the input for SharedArrayBuffer and ArrayBuffer on TextDecoder.decode
Based on @jasnell's recommendation
cc @nodejs/performance
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1212/
confidence improvement accuracy (*) (**) (***)
util/text-decoder.js type='ArrayBuffer' n=100 len=16384 ignoreBOM=0 encoding='iso-8859-3' 7.47 % ±9.99% ±13.30% ±17.31%
util/text-decoder.js type='ArrayBuffer' n=100 len=16384 ignoreBOM=0 encoding='latin1' * 10.43 % ±8.50% ±11.30% ±14.71%
util/text-decoder.js type='ArrayBuffer' n=100 len=16384 ignoreBOM=0 encoding='utf-8' 5.30 % ±6.78% ±9.04% ±11.81%
util/text-decoder.js type='ArrayBuffer' n=100 len=16384 ignoreBOM=1 encoding='iso-8859-3' 0.11 % ±9.96% ±13.25% ±17.24%
util/text-decoder.js type='ArrayBuffer' n=100 len=16384 ignoreBOM=1 encoding='latin1' 2.40 % ±8.54% ±11.36% ±14.78%
util/text-decoder.js type='ArrayBuffer' n=100 len=16384 ignoreBOM=1 encoding='utf-8' 3.43 % ±8.74% ±11.64% ±15.17%
util/text-decoder.js type='ArrayBuffer' n=100 len=256 ignoreBOM=0 encoding='iso-8859-3' *** 32.84 % ±12.48% ±16.65% ±21.74%
util/text-decoder.js type='ArrayBuffer' n=100 len=256 ignoreBOM=0 encoding='latin1' *** 27.25 % ±10.74% ±14.31% ±18.66%
util/text-decoder.js type='ArrayBuffer' n=100 len=256 ignoreBOM=0 encoding='utf-8' *** 36.39 % ±13.64% ±18.18% ±23.73%
util/text-decoder.js type='ArrayBuffer' n=100 len=256 ignoreBOM=1 encoding='iso-8859-3' *** 29.60 % ±11.42% ±15.21% ±19.81%
util/text-decoder.js type='ArrayBuffer' n=100 len=256 ignoreBOM=1 encoding='latin1' *** 26.58 % ±11.86% ±15.78% ±20.54%
util/text-decoder.js type='ArrayBuffer' n=100 len=256 ignoreBOM=1 encoding='utf-8' *** 26.81 % ±10.96% ±14.58% ±18.98%
util/text-decoder.js type='ArrayBuffer' n=100 len=524288 ignoreBOM=0 encoding='iso-8859-3' -3.16 % ±6.15% ±8.18% ±10.65%
util/text-decoder.js type='ArrayBuffer' n=100 len=524288 ignoreBOM=0 encoding='latin1' 2.83 % ±7.06% ±9.40% ±12.24%
util/text-decoder.js type='ArrayBuffer' n=100 len=524288 ignoreBOM=0 encoding='utf-8' -3.08 % ±6.04% ±8.05% ±10.48%
util/text-decoder.js type='ArrayBuffer' n=100 len=524288 ignoreBOM=1 encoding='iso-8859-3' -2.60 % ±7.61% ±10.13% ±13.19%
util/text-decoder.js type='ArrayBuffer' n=100 len=524288 ignoreBOM=1 encoding='latin1' -2.27 % ±7.37% ±9.80% ±12.76%
util/text-decoder.js type='ArrayBuffer' n=100 len=524288 ignoreBOM=1 encoding='utf-8' 4.71 % ±6.94% ±9.24% ±12.03%
util/text-decoder.js type='Buffer' n=100 len=16384 ignoreBOM=0 encoding='iso-8859-3' 6.20 % ±11.38% ±15.15% ±19.73%
util/text-decoder.js type='Buffer' n=100 len=16384 ignoreBOM=0 encoding='latin1' 5.15 % ±9.10% ±12.12% ±15.79%
util/text-decoder.js type='Buffer' n=100 len=16384 ignoreBOM=0 encoding='utf-8' 0.88 % ±11.25% ±14.96% ±19.48%
util/text-decoder.js type='Buffer' n=100 len=16384 ignoreBOM=1 encoding='iso-8859-3' -5.50 % ±9.90% ±13.18% ±17.15%
util/text-decoder.js type='Buffer' n=100 len=16384 ignoreBOM=1 encoding='latin1' 1.15 % ±8.39% ±11.17% ±14.55%
util/text-decoder.js type='Buffer' n=100 len=16384 ignoreBOM=1 encoding='utf-8' 3.79 % ±14.27% ±18.99% ±24.71%
util/text-decoder.js type='Buffer' n=100 len=256 ignoreBOM=0 encoding='iso-8859-3' 9.18 % ±11.30% ±15.04% ±19.58%
util/text-decoder.js type='Buffer' n=100 len=256 ignoreBOM=0 encoding='latin1' * 15.81 % ±13.25% ±17.73% ±23.28%
util/text-decoder.js type='Buffer' n=100 len=256 ignoreBOM=0 encoding='utf-8' 2.84 % ±10.10% ±13.45% ±17.51%
util/text-decoder.js type='Buffer' n=100 len=256 ignoreBOM=1 encoding='iso-8859-3' -0.79 % ±11.28% ±15.02% ±19.58%
util/text-decoder.js type='Buffer' n=100 len=256 ignoreBOM=1 encoding='latin1' 3.46 % ±9.30% ±12.38% ±16.13%
util/text-decoder.js type='Buffer' n=100 len=256 ignoreBOM=1 encoding='utf-8' 2.41 % ±9.73% ±12.96% ±16.87%
util/text-decoder.js type='Buffer' n=100 len=524288 ignoreBOM=0 encoding='iso-8859-3' 6.12 % ±6.78% ±9.02% ±11.74%
util/text-decoder.js type='Buffer' n=100 len=524288 ignoreBOM=0 encoding='latin1' 3.18 % ±6.18% ±8.22% ±10.70%
util/text-decoder.js type='Buffer' n=100 len=524288 ignoreBOM=0 encoding='utf-8' 0.28 % ±7.33% ±9.77% ±12.73%
util/text-decoder.js type='Buffer' n=100 len=524288 ignoreBOM=1 encoding='iso-8859-3' -3.97 % ±6.21% ±8.27% ±10.76%
util/text-decoder.js type='Buffer' n=100 len=524288 ignoreBOM=1 encoding='latin1' -4.25 % ±6.72% ±8.94% ±11.63%
util/text-decoder.js type='Buffer' n=100 len=524288 ignoreBOM=1 encoding='utf-8' -0.13 % ±4.92% ±6.54% ±8.51%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=16384 ignoreBOM=0 encoding='iso-8859-3' * 12.96 % ±10.21% ±13.59% ±17.71%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=16384 ignoreBOM=0 encoding='latin1' * 15.27 % ±13.12% ±17.54% ±23.00%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=16384 ignoreBOM=0 encoding='utf-8' * 9.76 % ±8.54% ±11.37% ±14.80%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=16384 ignoreBOM=1 encoding='iso-8859-3' 7.90 % ±8.94% ±11.92% ±15.55%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=16384 ignoreBOM=1 encoding='latin1' 5.69 % ±10.00% ±13.31% ±17.33%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=16384 ignoreBOM=1 encoding='utf-8' 8.02 % ±9.13% ±12.15% ±15.82%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=256 ignoreBOM=0 encoding='iso-8859-3' *** 37.73 % ±13.23% ±17.71% ±23.27%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=256 ignoreBOM=0 encoding='latin1' *** 33.53 % ±10.06% ±13.40% ±17.49%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=256 ignoreBOM=0 encoding='utf-8' ** 18.71 % ±10.85% ±14.45% ±18.82%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=256 ignoreBOM=1 encoding='iso-8859-3' *** 36.62 % ±10.20% ±13.58% ±17.71%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=256 ignoreBOM=1 encoding='latin1' *** 29.98 % ±6.95% ±9.24% ±12.04%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=256 ignoreBOM=1 encoding='utf-8' *** 29.35 % ±9.48% ±12.62% ±16.43%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=524288 ignoreBOM=0 encoding='iso-8859-3' -0.31 % ±6.59% ±8.77% ±11.42%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=524288 ignoreBOM=0 encoding='latin1' -0.23 % ±7.59% ±10.11% ±13.16%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=524288 ignoreBOM=0 encoding='utf-8' -0.15 % ±6.81% ±9.06% ±11.79%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=524288 ignoreBOM=1 encoding='iso-8859-3' 0.32 % ±7.52% ±10.01% ±13.04%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=524288 ignoreBOM=1 encoding='latin1' -2.21 % ±7.33% ±9.76% ±12.71%
util/text-decoder.js type='SharedArrayBuffer' n=100 len=524288 ignoreBOM=1 encoding='utf-8' -1.12 % ±7.53% ±10.02% ±13.05%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 54 comparisons, you can thus
expect the following amount of false-positive results:
2.70 false positives, when considering a 5% risk acceptance (*, **, ***),
0.54 false positives, when considering a 1% risk acceptance (**, ***),
0.05 false positives, when considering a 0.1% risk acceptance (***)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
bricss and daliborgogic reacted with thumbs up emoji
anonrig
added
the
request-ci
Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review.
label
Nov 7, 2022
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
|
FWIW it'd be better to post the results as text instead of a screenshot of the results.
|
anonrig reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
FWIW it'd be better to post the results as text instead of a screenshot of the results.
I'll do it after the benchmark ci is completed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
anonrig
added
the
request-ci
Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review.
label
Nov 7, 2022
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
anonrig
changed the title
util: improve text-decoder performance up to 31%
util: improve text-decoder performance up to 37%
Nov 7, 2022
|
(Side note: while a good sales strategy, I guess, it is not very scientific to cherry-pick the highest percentage and put it into the title. A different set of benchmarks would likely give you an entirely different result.)
|
BridgeAR reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
anonrig
changed the title
util: improve text-decoder performance up to 37%
util: improve text-decoder performance
Nov 7, 2022
anonrig
commented
Nov 7, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
(Side note: while a good sales strategy, I guess, it is not very scientific to cherry-pick the highest percentage and put it into the title. A different set of benchmarks would likely give you an entirely different result.)
I removed it. (This is why I added up to)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
anonrig
added
the
request-ci
Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review.
label
Nov 7, 2022
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 11, 2022
Reviewers
Trott
Trott approved these changes
addaleax
addaleax approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
c++
Issues and PRs that require attention from people who are familiar with C++.
commit-queue-rebase
PRs the Commit Queue should land as multiple self-contained commits.
encoding
Issues and PRs related to the TextEncoder and TextDecoder APIs.
i18n-api
Issues and PRs related to Node.js internationalization support.
needs-ci
PRs that need a full CI run.
performance
Issues and PRs related to the performance of Node.js.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|