node icon indicating copy to clipboard operation
node copied to clipboard

buffer: add fast api for isAscii & isUtf8

Open anonrig opened this issue 7 months ago • 3 comments

Adds v8 fast api for IsUtf8 and IsAscii methods

isAscii benchmark: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1706/

                                                                        confidence improvement accuracy (*)   (**)  (***)
buffers/buffer-isascii.js input='hello world' length='long' n=20000000         ***     37.08 %       ±0.87% ±1.17% ±1.52%
buffers/buffer-isascii.js input='hello world' length='short' n=20000000        ***     36.83 %       ±0.86% ±1.15% ±1.51%

isUtf8 benchmark: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1708/

buffers/buffer-isutf8.js input='∀x∈ℝ: ⌈x⌉ = −⌊−x⌋' length='long' n=20000000         ***      1.95 %       ±0.22% ±0.29% ±0.38%
buffers/buffer-isutf8.js input='∀x∈ℝ: ⌈x⌉ = −⌊−x⌋' length='short' n=20000000        ***     65.95 %       ±2.35% ±3.13% ±4.08%
buffers/buffer-isutf8.js input='regular string' length='long' n=20000000            ***     42.16 %       ±4.05% ±5.39% ±7.02%
buffers/buffer-isutf8.js input='regular string' length='short' n=20000000           ***    121.41 %       ±1.15% ±1.54% ±2.02%

anonrig avatar Apr 28 '25 01:04 anonrig

Codecov Report

Attention: Patch coverage is 76.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 90.16%. Comparing base (723d7bb) to head (6b11f13). Report is 427 commits behind head on main.

Files with missing lines Patch % Lines
src/node_buffer.cc 76.00% 4 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58058      +/-   ##
==========================================
- Coverage   90.17%   90.16%   -0.02%     
==========================================
  Files         630      630              
  Lines      186473   186496      +23     
  Branches    36613    36614       +1     
==========================================
+ Hits       168160   168162       +2     
- Misses      11128    11132       +4     
- Partials     7185     7202      +17     
Files with missing lines Coverage Δ
src/node_buffer.cc 69.20% <76.00%> (+0.10%) :arrow_up:

... and 24 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 28 '25 02:04 codecov[bot]

@jasnell @Renegade334 can you review this pull-request one more time?

anonrig avatar May 03 '25 16:05 anonrig

CI: https://ci.nodejs.org/job/node-test-pull-request/66565/

nodejs-github-bot avatar May 03 '25 16:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66666/

nodejs-github-bot avatar May 07 '25 02:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66724/

nodejs-github-bot avatar May 09 '25 01:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67660/

nodejs-github-bot avatar Jun 26 '25 02:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67696/

nodejs-github-bot avatar Jun 28 '25 07:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67705/

nodejs-github-bot avatar Jun 28 '25 16:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67706/

nodejs-github-bot avatar Jun 28 '25 17:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67710/

nodejs-github-bot avatar Jun 28 '25 20:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67712/

nodejs-github-bot avatar Jun 29 '25 00:06 nodejs-github-bot

The failure in CI here is not a flaky failure. It's relevant to the change being made here. That should be fixed before trying CI again.

jasnell avatar Jun 29 '25 21:06 jasnell