Skip to content

lib: use js-only implementation of isDataView()#62780

Open
Renegade334 wants to merge 2 commits intonodejs:mainfrom
Renegade334:js-isdataview
Open

lib: use js-only implementation of isDataView()#62780
Renegade334 wants to merge 2 commits intonodejs:mainfrom
Renegade334:js-isdataview

Conversation

@Renegade334
Copy link
Copy Markdown
Member

We already implement the TypedArray type check methods in the JS layer, as it's more performant to do it this way than to call into the embedder.

We can do the same with DataView – even though it potentially requires two JS calls, it's still more performant than using the V8 API, even when invoking the fast callback in a benchmarking scenario.

                                                                                          confidence improvement accuracy (*)    (**)   (***)
util/type-check.js n=1000000 argument='false-object' version='js' type='DataView'               ***     22.32 %       ±9.54% ±12.72% ±16.63%
util/type-check.js n=1000000 argument='false-primitive' version='js' type='DataView'            ***     64.16 %      ±11.84% ±15.79% ±20.64%
util/type-check.js n=1000000 argument='true' version='js' type='DataView'                       ***     26.70 %       ±8.24% ±10.99% ±14.34%

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Apr 16, 2026
@addaleax addaleax added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 16, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 16, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.67%. Comparing base (db9da5d) to head (966fbfc).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62780      +/-   ##
==========================================
- Coverage   91.54%   89.67%   -1.88%     
==========================================
  Files         356      706     +350     
  Lines      149604   218196   +68592     
  Branches    23392    41753   +18361     
==========================================
+ Hits       136961   195667   +58706     
- Misses      12380    14464    +2084     
- Partials      263     8065    +7802     
Files with missing lines Coverage Δ
lib/internal/util/types.js 100.00% <100.00%> (ø)
src/node_types.cc 94.87% <ø> (ø)

... and 475 files with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants