Skip to content

perf: Simple optimization#5356

Open
hansl wants to merge 2 commits intoboa-dev:mainfrom
hansl:simple-optimization
Open

perf: Simple optimization#5356
hansl wants to merge 2 commits intoboa-dev:mainfrom
hansl:simple-optimization

Conversation

@hansl
Copy link
Copy Markdown
Contributor

@hansl hansl commented May 6, 2026

Prior to this change, a lot of assignments defaulted to something like Move SRC, TMP; PushRegister TMP. With TMP being a temporary register. These are redundant as we could simple PushRegister SRC. This change removes those duplicated temporary registers.

Another part of this change is removing the temporary register when building an array literal; each non-spread elements were assigned to a temp register instead of directly being pushed on the array.

Both changes are improving the benchmarks by about 1-4%.

Prior to this change, a lot of assignments defaulted to something like
`Move SRC, TMP`; `PushRegister TMP`. With TMP being a temporary register. These are
redundant as we could simple PushRegister SRC.

This change removes those duplicated temporary registers, saving between
1-4% on benches.
@hansl hansl requested a review from a team as a code owner May 6, 2026 22:28
@github-actions github-actions Bot added C-VM Issues and PRs related to the Boa Virtual Machine. Waiting On Review Waiting on reviews from the maintainers labels May 6, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Test262 conformance changes

Test result main count PR count difference
Total 53,125 53,125 0
Passed 51,051 51,051 0
Ignored 1,482 1,482 0
Failed 592 592 0
Panics 0 0 0
Conformance 96.10% 96.10% 0.00%

Tested main commit: 8820b77750be087bff9448e6091baec9c8490f58
Tested PR commit: ae6fac4f2ad39f51eac1675ea53732a263b63049
Compare commits: 8820b77...ae6fac4

@github-actions github-actions Bot added the C-Tests Issues and PRs related to the tests. label May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 52.38095% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.86%. Comparing base (6ddc2b4) to head (ae6fac4).
⚠️ Report is 963 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/bytecompiler/mod.rs 45.00% 11 Missing ⚠️
core/engine/src/bytecompiler/expression/mod.rs 59.09% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5356       +/-   ##
===========================================
+ Coverage   47.24%   59.86%   +12.62%     
===========================================
  Files         476      566       +90     
  Lines       46892    62929    +16037     
===========================================
+ Hits        22154    37674    +15520     
- Misses      24738    25255      +517     

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

@hansl hansl enabled auto-merge May 6, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Tests Issues and PRs related to the tests. C-VM Issues and PRs related to the Boa Virtual Machine. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant