Skip to content

no redundant allocation in text decoder via ArrayBuffer::data()#4670

Merged
jedel1043 merged 4 commits intoboa-dev:mainfrom
zhuzhu81998:fix-decode-alloc
Feb 22, 2026
Merged

no redundant allocation in text decoder via ArrayBuffer::data()#4670
jedel1043 merged 4 commits intoboa-dev:mainfrom
zhuzhu81998:fix-decode-alloc

Conversation

@zhuzhu81998
Copy link
Contributor

@zhuzhu81998 zhuzhu81998 commented Feb 22, 2026

This Pull Request fixes #4362 .

Following the suggestion from @HalidOdat in #4358 .

Note that for Utf16Be, the decode function does in place swapping and thus requires mutability.

@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,472 49,472 0
Ignored 2,249 2,249 0
Failed 1,141 1,141 0
Panics 0 0 0
Conformance 93.59% 93.59% 0.00%

@zhuzhu81998
Copy link
Contributor Author

Just saw the work in #4650 , #4637, #4631 that all target basically the same area for different issues. And all of them still use the allocating version.
@jedel1043 it would make sense to at least merge #4631 first so that others can rebase?

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! Everything looks good, I just had a suggestion for the detached error message.

@jedel1043
Copy link
Member

jedel1043 commented Feb 22, 2026

I'll merge this first. #4631 needs another review pass.
EDIT: scratch this, seems like that PR got fixed sooner than I expected 😅

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.58%. Comparing base (6ddc2b4) to head (349c401).
⚠️ Report is 661 commits behind head on main.

Files with missing lines Patch % Lines
core/runtime/src/text/mod.rs 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4670      +/-   ##
==========================================
+ Coverage   47.24%   56.58%   +9.33%     
==========================================
  Files         476      548      +72     
  Lines       46892    60066   +13174     
==========================================
+ Hits        22154    33988   +11834     
- Misses      24738    26078    +1340     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@zhuzhu81998 zhuzhu81998 changed the title avoid redundant allocation in text-decoder via ArrayBuffer::data() no redundant allocation in text decoder via ArrayBuffer::data() Feb 22, 2026
@jedel1043 jedel1043 enabled auto-merge February 22, 2026 16:28
@jedel1043 jedel1043 added performance Performance related changes and issues builtins PRs and Issues related to builtins/intrinsics labels Feb 22, 2026
@jedel1043 jedel1043 added this pull request to the merge queue Feb 22, 2026
Merged via the queue into boa-dev:main with commit e8424e7 Feb 22, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builtins PRs and Issues related to builtins/intrinsics performance Performance related changes and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use ArrayBuffer::data() in the text decoder as an optimization

2 participants