Repository navigation
assert: avoid excess float array comparisons - #67357
Open
alejandrodev-vn wants to merge 1 commit into
Open
alejandrodev-vn wants to merge 1 commit into
alejandrodev-vn wants to merge 1 commit into
Conversation
Signed-off-by: alejandrodev-vn <huytra264@gmail.com>
Collaborator
|
Review requested:
|
Contributor
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
BridgeAR
approved these changes
Nov 9, 2026
BridgeAR
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you! Should we also add strict assertions?
Renegade334
approved these changes
Nov 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67357 +/- ##
==========================================
- Coverage 90.73% 90.72% -0.01%
==========================================
Files 798 798
Lines 279993 279994 +1
Branches 53866 53862 -4
==========================================
- Hits 254047 254037 -10
- Misses 16229 16237 +8
- Partials 9717 9720 +3
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
areSimilarFloatArrays()uses the byte length as the loop bound whileaccessing typed array elements by index. For equal arrays, this causes
unnecessary out-of-bounds reads after all elements have been compared.
Use
TypedArrayPrototypeGetLengthfor the length check and loop bound.The intrinsic getter avoids invoking an own
lengthproperty.Add coverage for Float16Array, Float32Array and Float64Array, including
subarrays, empty arrays, unequal lengths and shadowed length getters.
Add a benchmark covering equal arrays and several mismatch scenarios.
Local benchmark results for equal arrays with 5,000 elements:
These are median throughput results from 12 alternating before/after
runs on an Apple M4 Pro, macOS arm64, using a v28.0.0-pre development
build based on 7ae68bd.
The build loads builtins from disk. These measurements apply to this
microbenchmark and do not measure application throughput.
Validation:
make lintmake lint-yaml(completed with two comment-spacing warnings)make -j4 test(7,619 passed, 0 failed)Refs: #51040