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

chore: add benchmarks for to-string #32

Merged
merged 5 commits into from
Aug 2, 2022

Conversation

achingbrain
Copy link
Owner

@achingbrain achingbrain commented Aug 2, 2022

Adds benchmarks to compare various stringification methods

Node:

$ node benchmarks/to-string.js                                     
Uint8Arrays.toString x 349,476 ops/sec ±2.40% (82 runs sampled)
TextDecoder x 363,460 ops/sec ±3.77% (64 runs sampled)
utf8ReadFromCharCode x 1,833,389 ops/sec ±0.82% (90 runs sampled)
utf8ReadConcat x 1,182,950 ops/sec ±0.39% (89 runs sampled)
Buffer.toString x 3,322,147 ops/sec ±0.53% (87 runs sampled)
Fastest is Buffer.toString

Chrome:

$ npx playwright-test benchmarks/to-string.js --runner benchmark
✔ chromium set up
Uint8Arrays.toString x 1,245,619 ops/sec ±2.81% (63 runs sampled)
TextDecoder x 1,660,401 ops/sec ±1.62% (60 runs sampled)
utf8ReadFromCharCode x 2,867,464 ops/sec ±0.34% (67 runs sampled)
utf8ReadConcat x 1,737,527 ops/sec ±0.24% (68 runs sampled)
Fastest is utf8ReadFromCharCode

Firefox:

$ npx playwright-test benchmarks/to-string.js --runner benchmark --browser firefox 
✔ firefox set up
Uint8Arrays.toString x 1,662,562 ops/sec ±5.23% (60 runs sampled)
TextDecoder x 1,774,664 ops/sec ±7.01% (61 runs sampled)
utf8ReadFromCharCode x 1,324,124 ops/sec ±1.44% (64 runs sampled)
utf8ReadConcat x 769,512 ops/sec ±31.15% (32 runs sampled)
Fastest is TextDecoder

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2022

Codecov Report

Merging #32 (f3d52d7) into master (bd7147f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #32   +/-   ##
=======================================
  Coverage   96.76%   96.76%           
=======================================
  Files           8        8           
  Lines         247      247           
  Branches       49       49           
=======================================
  Hits          239      239           
  Misses          8        8           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd7147f...f3d52d7. Read the comment docs.

@achingbrain achingbrain merged commit 542f14a into master Aug 2, 2022
@achingbrain achingbrain deleted the chore/add-to-string-benchmark branch August 2, 2022 12:33
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