Skip to content

Potential Windows BenchmarkRunner fixes#62

Merged
frostney merged 1 commit intomainfrom
fixes-benchmarkrunner
Mar 10, 2026
Merged

Potential Windows BenchmarkRunner fixes#62
frostney merged 1 commit intomainfrom
fixes-benchmarkrunner

Conversation

@frostney
Copy link
Copy Markdown
Owner

@frostney frostney commented Mar 10, 2026

Summary by CodeRabbit

  • Refactor
    • Optimized internal memory management and garbage collection handling to improve overall application stability and performance.
    • Simplified benchmark operation processing flow for cleaner code structure and more efficient resource lifecycle management.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0b1a1f9-9cbc-485e-9be6-4a2569d0bcb1

📥 Commits

Reviewing files that changed from the base of the PR and between c34c258 and e655e12.

📒 Files selected for processing (2)
  • BenchmarkRunner.dpr
  • units/Goccia.Runtime.Operations.pas
💤 Files with no reviewable changes (1)
  • units/Goccia.Runtime.Operations.pas

📝 Walkthrough

Walkthrough

The pull request refactors five functions in BenchmarkRunner.dpr into procedures, eliminating return values and out parameters while adding explicit garbage-collection root management. Concurrently, temporary GC root registrations are removed from iterator and enum lifecycle handling in Goccia.Runtime.Operations.pas.

Changes

Cohort / File(s) Summary
BenchmarkRunner Function-to-Procedure Conversions
BenchmarkRunner.dpr
Converted PopulateFileResult, MakeErrorFileResult, CollectBenchmarkFileInterpreted, CollectBenchmarkFileBytecode, and CollectBenchmarkFile from functions returning TGocciaObjectValue to procedures. Removed return values and out parameters; result propagation now relies on side effects through AReporter. Added AddTempRoot/RemoveTempRoot calls around ScriptResult and ResultValue to manage GC lifetime; GC collection invoked at relevant block ends.
Runtime Iterator/Enum GC Cleanup
units/Goccia.Runtime.Operations.pas
Removed TGarbageCollector.Instance.AddTempRoot calls for Iterator, IteratorObj, and EnumObj objects in GetIterator and FinalizeEnum procedures, eliminating temporary GC root registrations for transient iterator and enum objects.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • Unify garbage collector #60: Directly related through code-level changes to garbage-collector usage patterns, including adjustments to temp-root management and explicit collection calls across BenchmarkRunner and runtime operations.

Poem

🐰 Functions hop to procedures' grace,
GC roots dance through time and space,
Iterators freed from chains of care,
Results now float on side-effect air. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references 'Windows BenchmarkRunner fixes' but the PR objectives indicate this is about reapplying adjustments to ensure bytecode GC and interpreter behavior remain consistent across platforms, not Windows-specific fixes. Update the title to better reflect the actual purpose: consider 'Reapply BenchmarkRunner GC handling adjustments' or similar to accurately describe the cross-platform consistency focus.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fixes-benchmarkrunner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@frostney frostney changed the title Reapply BenchmarkRunner fixes Potential Windows BenchmarkRunner fixes Mar 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results

254 benchmarks

Interpreted: 🟢 223 improved · 31 unchanged · avg +10.8%
Bytecode: 🟢 15 improved · 🔴 9 regressed · 230 unchanged · avg +0.6%

arraybuffer.js — Interp: 🟢 10, 4 unch. · avg +11.7% · Bytecode: 14 unch. · avg +1.1%
Benchmark Interpreted Δ Bytecode Δ
create ArrayBuffer(0) 408,530 → 466,449 🟢 +14.2% 138,982 → 137,957 -0.7%
create ArrayBuffer(64) 404,378 → 462,536 🟢 +14.4% 136,899 → 137,438 +0.4%
create ArrayBuffer(1024) 311,143 → 370,848 🟢 +19.2% 125,255 → 124,853 -0.3%
create ArrayBuffer(8192) 130,467 → 134,295 +2.9% 82,912 → 82,296 -0.7%
slice full buffer (64 bytes) 508,593 → 584,572 🟢 +14.9% 355,734 → 365,468 +2.7%
slice half buffer (512 of 1024 bytes) 430,028 → 499,762 🟢 +16.2% 320,573 → 328,165 +2.4%
slice with negative indices 435,930 → 511,802 🟢 +17.4% 343,729 → 353,017 +2.7%
slice empty range 490,364 → 564,592 🟢 +15.1% 352,567 → 359,982 +2.1%
byteLength access 1,563,341 → 1,631,363 +4.4% 982,678 → 995,051 +1.3%
Symbol.toStringTag access 1,115,156 → 1,123,694 +0.8% 508,582 → 519,979 +2.2%
ArrayBuffer.isView 707,606 → 796,506 🟢 +12.6% 438,585 → 441,848 +0.7%
clone ArrayBuffer(64) 371,332 → 420,357 🟢 +13.2% 311,049 → 310,419 -0.2%
clone ArrayBuffer(1024) 276,538 → 295,111 +6.7% 246,037 → 247,471 +0.6%
clone ArrayBuffer inside object 256,543 → 286,141 🟢 +11.5% 152,673 → 155,809 +2.1%
arrays.js — Interp: 🟢 14, 5 unch. · avg +9.2% · Bytecode: 🟢 1, 18 unch. · avg +1.4%
Benchmark Interpreted Δ Bytecode Δ
Array.from length 100 13,501 → 15,068 🟢 +11.6% 12,075 → 12,340 +2.2%
Array.from 10 elements 222,672 → 256,103 🟢 +15.0% 156,289 → 153,347 -1.9%
Array.of 10 elements 299,583 → 337,306 🟢 +12.6% 217,869 → 214,125 -1.7%
spread into new array 332,462 → 366,321 🟢 +10.2% 563,376 → 570,887 +1.3%
map over 50 elements 27,630 → 30,098 🟢 +8.9% 20,515 → 20,996 +2.3%
filter over 50 elements 23,446 → 25,769 🟢 +9.9% 20,186 → 20,645 +2.3%
reduce sum 50 elements 26,871 → 28,438 +5.8% 18,065 → 17,842 -1.2%
forEach over 50 elements 22,116 → 24,036 🟢 +8.7% 22,366 → 22,118 -1.1%
find in 50 elements 35,902 → 38,108 +6.1% 25,933 → 26,362 +1.7%
sort 20 elements 11,951 → 12,696 +6.2% 2,912 → 3,105 +6.6%
flat nested array 115,568 → 127,573 🟢 +10.4% 270,329 → 267,167 -1.2%
flatMap 72,266 → 81,949 🟢 +13.4% 187,588 → 202,271 🟢 +7.8%
map inside map (5x5) 21,376 → 23,583 🟢 +10.3% 68,515 → 67,822 -1.0%
filter inside map (5x10) 15,820 → 17,607 🟢 +11.3% 12,610 → 12,935 +2.6%
reduce inside map (5x10) 19,164 → 18,675 -2.5% 12,748 → 12,927 +1.4%
forEach inside forEach (5x10) 16,306 → 17,341 +6.4% 14,167 → 14,525 +2.5%
find inside some (10x10) 14,035 → 15,412 🟢 +9.8% 9,997 → 10,112 +1.1%
map+filter chain nested (5x20) 5,376 → 5,964 🟢 +10.9% 4,158 → 4,273 +2.7%
reduce flatten (10x5) 41,770 → 45,538 🟢 +9.0% 5,592 → 5,591 -0.0%
async-await.js — Interp: 🟢 6 · avg +12.8% · Bytecode: 6 unch. · avg +1.8%
Benchmark Interpreted Δ Bytecode Δ
single await 362,896 → 418,534 🟢 +15.3% 271,815 → 271,061 -0.3%
multiple awaits 165,231 → 187,339 🟢 +13.4% 115,503 → 111,848 -3.2%
await non-Promise value 805,079 → 945,413 🟢 +17.4% 893,226 → 955,620 +7.0%
await with try/catch 360,742 → 401,142 🟢 +11.2% 260,552 → 264,219 +1.4%
await Promise.all 50,920 → 55,797 🟢 +9.6% 39,208 → 40,662 +3.7%
nested async function call 184,929 → 202,726 🟢 +9.6% 199,423 → 204,081 +2.3%
classes.js — Interp: 🟢 30, 1 unch. · avg +12.0% · Bytecode: 31 unch. · avg +0.1%
Benchmark Interpreted Δ Bytecode Δ
simple class new 114,928 → 126,532 🟢 +10.1% 335,692 → 331,713 -1.2%
class with defaults 91,169 → 101,921 🟢 +11.8% 235,799 → 230,123 -2.4%
50 instances via Array.from 5,601 → 5,978 +6.7% 6,096 → 6,014 -1.3%
instance method call 58,437 → 64,652 🟢 +10.6% 153,199 → 152,183 -0.7%
static method call 90,961 → 101,826 🟢 +11.9% 360,679 → 346,051 -4.1%
single-level inheritance 45,731 → 50,336 🟢 +10.1% 152,302 → 149,435 -1.9%
two-level inheritance 38,687 → 42,469 🟢 +9.8% 124,798 → 120,310 -3.6%
private field access 57,735 → 64,026 🟢 +10.9% 164,844 → 166,920 +1.3%
private methods 62,905 → 69,777 🟢 +10.9% 203,368 → 206,191 +1.4%
getter/setter access 64,798 → 71,871 🟢 +10.9% 165,851 → 166,089 +0.1%
class decorator (identity) 80,558 → 90,610 🟢 +12.5% 52,266 → 52,894 +1.2%
class decorator (wrapping) 47,288 → 52,167 🟢 +10.3% 36,355 → 36,692 +0.9%
identity method decorator 58,001 → 65,687 🟢 +13.3% 43,076 → 43,977 +2.1%
wrapping method decorator 48,175 → 53,961 🟢 +12.0% 39,303 → 39,533 +0.6%
stacked method decorators (x3) 33,785 → 38,511 🟢 +14.0% 27,347 → 27,989 +2.3%
identity field decorator 66,426 → 75,013 🟢 +12.9% 45,177 → 46,125 +2.1%
field initializer decorator 56,196 → 63,518 🟢 +13.0% 40,634 → 41,201 +1.4%
getter decorator (identity) 57,492 → 65,207 🟢 +13.4% 40,332 → 40,872 +1.3%
setter decorator (identity) 48,606 → 55,121 🟢 +13.4% 34,599 → 35,305 +2.0%
static method decorator 61,573 → 70,255 🟢 +14.1% 62,436 → 62,622 +0.3%
static field decorator 72,286 → 81,903 🟢 +13.3% 66,039 → 66,343 +0.5%
private method decorator 47,495 → 54,736 🟢 +15.2% 36,556 → 36,930 +1.0%
private field decorator 52,700 → 60,800 🟢 +15.4% 38,128 → 38,540 +1.1%
plain auto-accessor (no decorator) 89,713 → 99,811 🟢 +11.3% 52,101 → 53,659 +3.0%
auto-accessor with decorator 51,830 → 59,439 🟢 +14.7% 36,794 → 37,443 +1.8%
decorator writing metadata 43,888 → 49,642 🟢 +13.1% 41,142 → 41,776 +1.5%
static getter read 105,682 → 119,752 🟢 +13.3% 376,052 → 370,300 -1.5%
static getter/setter pair 79,439 → 87,937 🟢 +10.7% 204,605 → 201,120 -1.7%
inherited static getter 60,139 → 67,213 🟢 +11.8% 258,446 → 253,393 -2.0%
inherited static setter 65,523 → 72,813 🟢 +11.1% 204,376 → 201,399 -1.5%
inherited static getter with this binding 54,520 → 60,213 🟢 +10.4% 149,332 → 146,964 -1.6%
closures.js — Interp: 🟢 10, 1 unch. · avg +9.1% · Bytecode: 11 unch. · avg +1.6%
Benchmark Interpreted Δ Bytecode Δ
closure over single variable 152,071 → 158,727 +4.4% 585,193 → 598,157 +2.2%
closure over multiple variables 123,296 → 133,895 🟢 +8.6% 388,594 → 396,553 +2.0%
nested closures 128,182 → 138,510 🟢 +8.1% 544,217 → 559,141 +2.7%
function as argument 95,739 → 105,294 🟢 +10.0% 486,798 → 492,648 +1.2%
function returning function 121,932 → 131,245 🟢 +7.6% 580,156 → 595,700 +2.7%
compose two functions 72,401 → 78,676 🟢 +8.7% 344,513 → 358,409 +4.0%
fn.call 155,997 → 171,773 🟢 +10.1% 128,042 → 127,966 -0.1%
fn.apply 115,846 → 129,389 🟢 +11.7% 87,757 → 89,082 +1.5%
fn.bind 139,208 → 155,890 🟢 +12.0% 137,795 → 136,733 -0.8%
recursive sum to 50 11,930 → 13,059 🟢 +9.5% 38,250 → 38,383 +0.3%
recursive tree traversal 20,007 → 21,863 🟢 +9.3% 57,282 → 58,207 +1.6%
collections.js — Interp: 🟢 11, 1 unch. · avg +9.2% · Bytecode: 🟢 4, 8 unch. · avg +6.5%
Benchmark Interpreted Δ Bytecode Δ
add 50 elements 6,911 → 7,456 🟢 +7.9% 5,495 → 5,482 -0.2%
has lookup (50 elements) 82,669 → 92,512 🟢 +11.9% 80,662 → 84,545 +4.8%
delete elements 45,026 → 49,163 🟢 +9.2% 34,830 → 36,358 +4.4%
forEach iteration 16,609 → 18,054 🟢 +8.7% 15,059 → 15,362 +2.0%
spread to array 40,260 → 40,287 +0.1% 119,328 → 144,404 🟢 +21.0%
deduplicate array 43,586 → 47,322 🟢 +8.6% 44,400 → 46,146 +3.9%
set 50 entries 5,069 → 5,645 🟢 +11.4% 5,314 → 5,651 +6.3%
get lookup (50 entries) 78,046 → 87,452 🟢 +12.1% 84,276 → 93,170 🟢 +10.6%
has check 118,269 → 132,631 🟢 +12.1% 134,093 → 147,220 🟢 +9.8%
delete entries 41,613 → 45,851 🟢 +10.2% 32,157 → 34,831 🟢 +8.3%
forEach iteration 16,357 → 17,849 🟢 +9.1% 14,946 → 15,389 +3.0%
keys/values/entries 9,538 → 10,456 🟢 +9.6% 19,730 → 20,609 +4.5%
destructuring.js — Interp: 🟢 21, 1 unch. · avg +11.7% · Bytecode: 🟢 1, 21 unch. · avg -0.5%
Benchmark Interpreted Δ Bytecode Δ
simple array destructuring 438,756 → 480,298 🟢 +9.5% 630,467 → 626,663 -0.6%
with rest element 287,016 → 317,244 🟢 +10.5% 491,064 → 486,739 -0.9%
with defaults 426,361 → 482,722 🟢 +13.2% 703,953 → 680,750 -3.3%
skip elements 439,851 → 493,276 🟢 +12.1% 724,678 → 717,080 -1.0%
nested array destructuring 191,888 → 202,097 +5.3% 355,978 → 349,230 -1.9%
swap variables 532,904 → 590,380 🟢 +10.8% 978,686 → 972,022 -0.7%
simple object destructuring 308,706 → 350,257 🟢 +13.5% 501,835 → 500,073 -0.4%
with defaults 361,378 → 420,325 🟢 +16.3% 306,273 → 305,169 -0.4%
with renaming 327,662 → 378,272 🟢 +15.4% 561,710 → 558,854 -0.5%
nested object destructuring 157,243 → 168,443 🟢 +7.1% 247,195 → 243,854 -1.4%
rest properties 194,444 → 213,468 🟢 +9.8% 234,973 → 231,154 -1.6%
object parameter 95,338 → 105,056 🟢 +10.2% 184,930 → 184,083 -0.5%
array parameter 128,260 → 144,481 🟢 +12.6% 318,705 → 318,838 +0.0%
mixed destructuring in map 35,471 → 41,241 🟢 +16.3% 33,469 → 33,966 +1.5%
forEach with array destructuring 71,004 → 76,362 🟢 +7.5% 137,495 → 135,080 -1.8%
map with array destructuring 71,491 → 79,031 🟢 +10.5% 167,827 → 165,860 -1.2%
filter with array destructuring 73,920 → 82,083 🟢 +11.0% 198,301 → 194,441 -1.9%
reduce with array destructuring 80,929 → 88,354 🟢 +9.2% 170,252 → 178,531 +4.9%
map with object destructuring 78,683 → 90,613 🟢 +15.2% 65,884 → 70,724 🟢 +7.3%
map with nested destructuring 64,122 → 73,355 🟢 +14.4% 58,525 → 59,918 +2.4%
map with rest in destructuring 40,223 → 45,343 🟢 +12.7% 45,237 → 43,093 -4.7%
map with defaults in destructuring 59,985 → 68,667 🟢 +14.5% 36,839 → 35,291 -4.2%
fibonacci.js — Interp: 🟢 6, 2 unch. · avg +9.2% · Bytecode: 🟢 1, 🔴 2, 5 unch. · avg -0.7%
Benchmark Interpreted Δ Bytecode Δ
recursive fib(15) 368 → 376 +2.1% 1,088 → 1,109 +1.9%
recursive fib(20) 30 → 32 🟢 +8.6% 101 → 100 -1.2%
recursive fib(15) typed 333 → 356 +6.7% 1,312 → 1,417 🟢 +8.0%
recursive fib(20) typed 29 → 32 🟢 +9.0% 128 → 128 -0.3%
iterative fib(20) via reduce 12,682 → 14,108 🟢 +11.3% 8,453 → 7,852 🔴 -7.1%
iterator fib(20) 9,908 → 11,023 🟢 +11.2% 14,307 → 13,595 -5.0%
iterator fib(20) via Iterator.from + take 15,161 → 16,798 🟢 +10.8% 15,905 → 14,608 🔴 -8.2%
iterator fib(20) last value via reduce 11,433 → 12,982 🟢 +13.5% 11,782 → 12,478 +5.9%
for-of.js — Interp: 🟢 4, 3 unch. · avg +7.7% · Bytecode: 🟢 2, 🔴 1, 4 unch. · avg +3.4%
Benchmark Interpreted Δ Bytecode Δ
for...of with 10-element array 54,341 → 56,405 +3.8% 151,175 → 164,727 🟢 +9.0%
for...of with 100-element array 6,097 → 6,390 +4.8% 21,238 → 22,142 +4.3%
for...of with string (10 chars) 36,371 → 40,632 🟢 +11.7% 110,594 → 127,992 🟢 +15.7%
for...of with Set (10 elements) 53,020 → 55,764 +5.2% 160,353 → 164,209 +2.4%
for...of with Map entries (10 entries) 33,061 → 36,909 🟢 +11.6% 51,188 → 43,390 🔴 -15.2%
for...of with destructuring 45,197 → 48,649 🟢 +7.6% 86,622 → 89,113 +2.9%
for-await-of with sync array 49,545 → 54,223 🟢 +9.4% 131,347 → 137,214 +4.5%
iterators.js — Interp: 🟢 20 · avg +12.2% · Bytecode: 🟢 2, 🔴 1, 17 unch. · avg +1.6%
Benchmark Interpreted Δ Bytecode Δ
Iterator.from({next}).toArray() — 20 elements 15,766 → 17,557 🟢 +11.4% 16,402 → 16,158 -1.5%
Iterator.from({next}).toArray() — 50 elements 6,947 → 7,599 🟢 +9.4% 7,521 → 6,930 🔴 -7.9%
spread pre-wrapped iterator — 20 elements 12,287 → 14,063 🟢 +14.5% 16,270 → 15,997 -1.7%
Iterator.from({next}).forEach — 50 elements 4,729 → 5,270 🟢 +11.4% 5,291 → 5,302 +0.2%
Iterator.from({next}).reduce — 50 elements 4,727 → 5,313 🟢 +12.4% 4,964 → 5,101 +2.8%
wrap array iterator 178,067 → 200,127 🟢 +12.4% 117,422 → 122,908 +4.7%
wrap plain {next()} object 10,918 → 11,941 🟢 +9.4% 11,862 → 11,671 -1.6%
map + toArray (50 elements) 4,833 → 5,391 🟢 +11.5% 5,249 → 5,208 -0.8%
filter + toArray (50 elements) 4,685 → 5,231 🟢 +11.7% 5,197 → 5,074 -2.4%
take(10) + toArray (50 element source) 28,308 → 31,137 🟢 +10.0% 27,334 → 28,037 +2.6%
drop(40) + toArray (50 element source) 6,727 → 7,442 🟢 +10.6% 7,448 → 7,285 -2.2%
chained map + filter + take (100 element source) 8,736 → 9,686 🟢 +10.9% 9,107 → 9,414 +3.4%
some + every (50 elements) 2,730 → 3,057 🟢 +12.0% 2,979 → 3,046 +2.3%
find (50 elements) 5,953 → 6,647 🟢 +11.6% 6,530 → 6,559 +0.4%
array.values().map().filter().toArray() 9,300 → 10,413 🟢 +12.0% 9,337 → 9,519 +1.9%
array.values().take(5).toArray() 214,510 → 243,454 🟢 +13.5% 146,508 → 153,527 +4.8%
array.values().drop(45).toArray() 201,252 → 226,868 🟢 +12.7% 136,145 → 148,468 🟢 +9.1%
map.entries() chained helpers 10,707 → 12,932 🟢 +20.8% 4,811 → 5,492 🟢 +14.2%
set.values() chained helpers 19,113 → 21,484 🟢 +12.4% 19,641 → 20,153 +2.6%
string iterator map + toArray 14,539 → 16,369 🟢 +12.6% 20,430 → 20,793 +1.8%
json.js — Interp: 🟢 18, 2 unch. · avg +9.4% · Bytecode: 🔴 4, 16 unch. · avg -3.9%
Benchmark Interpreted Δ Bytecode Δ
parse simple object 194,974 → 206,037 +5.7% 157,639 → 142,580 🔴 -9.6%
parse nested object 117,156 → 125,667 🟢 +7.3% 108,314 → 100,703 🔴 -7.0%
parse array of objects 60,531 → 65,978 🟢 +9.0% 61,698 → 55,724 🔴 -9.7%
parse large flat object 51,823 → 55,562 🟢 +7.2% 48,039 → 47,688 -0.7%
parse mixed types 75,523 → 83,611 🟢 +10.7% 70,506 → 65,838 -6.6%
stringify simple object 152,386 → 167,446 🟢 +9.9% 136,633 → 131,469 -3.8%
stringify nested object 83,795 → 90,770 🟢 +8.3% 74,501 → 69,504 -6.7%
stringify array of objects 39,389 → 41,632 +5.7% 35,416 → 34,678 -2.1%
stringify mixed types 71,476 → 77,878 🟢 +9.0% 64,085 → 60,877 -5.0%
reviver doubles numbers 46,630 → 52,289 🟢 +12.1% 46,619 → 45,464 -2.5%
reviver filters properties 39,026 → 44,180 🟢 +13.2% 46,302 → 45,650 -1.4%
reviver on nested object 53,225 → 58,990 🟢 +10.8% 51,519 → 46,641 🔴 -9.5%
reviver on array 29,994 → 32,986 🟢 +10.0% 28,335 → 28,429 +0.3%
replacer function doubles numbers 46,738 → 51,520 🟢 +10.2% 47,460 → 47,577 +0.2%
replacer function excludes properties 60,475 → 66,876 🟢 +10.6% 57,688 → 56,872 -1.4%
array replacer (allowlist) 108,824 → 120,068 🟢 +10.3% 90,029 → 88,422 -1.8%
stringify with 2-space indent 81,296 → 89,198 🟢 +9.7% 69,229 → 66,643 -3.7%
stringify with tab indent 82,175 → 88,626 🟢 +7.8% 69,548 → 67,267 -3.3%
parse then stringify 48,313 → 53,319 🟢 +10.4% 44,624 → 44,065 -1.3%
stringify then parse 29,010 → 31,862 🟢 +9.8% 26,847 → 26,142 -2.6%
jsx.jsx — Interp: 🟢 20, 1 unch. · avg +12.1% · Bytecode: 21 unch. · avg +0.3%
Benchmark Interpreted Δ Bytecode Δ
simple element 246,582 → 261,322 +6.0% 663,281 → 699,345 +5.4%
self-closing element 232,838 → 252,669 🟢 +8.5% 701,045 → 720,360 +2.8%
element with string attribute 191,325 → 208,386 🟢 +8.9% 438,991 → 435,299 -0.8%
element with multiple attributes 161,048 → 181,329 🟢 +12.6% 359,485 → 357,522 -0.5%
element with expression attribute 172,236 → 200,977 🟢 +16.7% 415,570 → 414,873 -0.2%
text child 221,614 → 245,571 🟢 +10.8% 575,345 → 592,243 +2.9%
expression child 212,904 → 239,925 🟢 +12.7% 578,900 → 589,403 +1.8%
mixed text and expression 203,468 → 226,897 🟢 +11.5% 535,768 → 520,374 -2.9%
nested elements (3 levels) 80,917 → 91,179 🟢 +12.7% 229,158 → 238,507 +4.1%
sibling children 59,579 → 67,252 🟢 +12.9% 180,270 → 184,057 +2.1%
component element 152,833 → 174,132 🟢 +13.9% 416,836 → 420,001 +0.8%
component with children 93,732 → 105,574 🟢 +12.6% 267,200 → 258,723 -3.2%
dotted component 129,420 → 146,268 🟢 +13.0% 310,924 → 314,436 +1.1%
empty fragment 221,840 → 248,607 🟢 +12.1% 632,325 → 639,999 +1.2%
fragment with children 59,010 → 66,951 🟢 +13.5% 176,990 → 177,392 +0.2%
spread attributes 112,709 → 125,806 🟢 +11.6% 109,022 → 107,565 -1.3%
spread with overrides 98,362 → 110,307 🟢 +12.1% 83,085 → 82,140 -1.1%
shorthand props 165,611 → 187,827 🟢 +13.4% 405,329 → 407,285 +0.5%
nav bar structure 28,377 → 31,880 🟢 +12.3% 78,530 → 78,325 -0.3%
card component tree 33,073 → 37,182 🟢 +12.4% 86,611 → 85,080 -1.8%
10 list items via Array.from 15,272 → 17,261 🟢 +13.0% 23,739 → 22,815 -3.9%
numbers.js — Interp: 🟢 10, 1 unch. · avg +12.3% · Bytecode: 11 unch. · avg -1.3%
Benchmark Interpreted Δ Bytecode Δ
integer arithmetic 643,658 → 667,502 +3.7% 1,488,551 → 1,504,015 +1.0%
floating point arithmetic 678,762 → 739,482 🟢 +8.9% 1,585,863 → 1,602,918 +1.1%
number coercion 180,089 → 205,776 🟢 +14.3% 131,151 → 130,733 -0.3%
toFixed 104,725 → 121,377 🟢 +15.9% 204,947 → 202,397 -1.2%
toString 165,027 → 184,427 🟢 +11.8% 664,443 → 653,843 -1.6%
valueOf 234,830 → 264,270 🟢 +12.5% 917,773 → 906,021 -1.3%
toPrecision 149,517 → 166,114 🟢 +11.1% 399,906 → 382,829 -4.3%
Number.isNaN 285,724 → 327,864 🟢 +14.7% 168,324 → 165,838 -1.5%
Number.isFinite 282,011 → 320,280 🟢 +13.6% 162,831 → 158,861 -2.4%
Number.isInteger 276,600 → 315,946 🟢 +14.2% 176,359 → 173,758 -1.5%
Number.parseInt and parseFloat 241,258 → 277,494 🟢 +15.0% 149,905 → 145,623 -2.9%
objects.js — Interp: 🟢 4, 3 unch. · avg +8.0% · Bytecode: 🔴 1, 6 unch. · avg -2.9%
Benchmark Interpreted Δ Bytecode Δ
create simple object 511,534 → 557,679 🟢 +9.0% 862,246 → 838,147 -2.8%
create nested object 254,481 → 269,066 +5.7% 368,922 → 374,387 +1.5%
create 50 objects via Array.from 10,245 → 11,419 🟢 +11.5% 8,371 → 7,559 🔴 -9.7%
property read 646,637 → 654,645 +1.2% 642,650 → 625,874 -2.6%
Object.keys 302,994 → 341,173 🟢 +12.6% 223,129 → 211,836 -5.1%
Object.entries 113,231 → 120,445 +6.4% 76,318 → 72,435 -5.1%
spread operator 202,283 → 222,097 🟢 +9.8% 198,097 → 204,421 +3.2%
promises.js — Interp: 🟢 9, 3 unch. · avg +7.5% · Bytecode: 🟢 3, 9 unch. · avg +4.0%
Benchmark Interpreted Δ Bytecode Δ
Promise.resolve(value) 560,197 → 617,149 🟢 +10.2% 363,396 → 362,590 -0.2%
new Promise(resolve => resolve(value)) 205,661 → 212,476 +3.3% 175,687 → 167,930 -4.4%
Promise.reject(reason) 561,165 → 628,564 🟢 +12.0% 334,303 → 331,151 -0.9%
resolve + then (1 handler) 175,621 → 195,019 🟢 +11.0% 149,944 → 159,804 +6.6%
resolve + then chain (3 deep) 69,188 → 72,966 +5.5% 67,399 → 75,770 🟢 +12.4%
resolve + then chain (10 deep) 23,784 → 23,327 -1.9% 22,866 → 25,369 🟢 +10.9%
reject + catch + then 105,694 → 114,677 🟢 +8.5% 94,279 → 97,132 +3.0%
resolve + finally + then 89,414 → 95,903 🟢 +7.3% 81,196 → 84,900 +4.6%
Promise.all (5 resolved) 34,802 → 37,696 🟢 +8.3% 26,232 → 27,344 +4.2%
Promise.race (5 resolved) 36,655 → 40,106 🟢 +9.4% 27,053 → 26,692 -1.3%
Promise.allSettled (5 mixed) 29,795 → 32,536 🟢 +9.2% 24,741 → 25,744 +4.1%
Promise.any (5 mixed) 34,189 → 36,798 🟢 +7.6% 26,351 → 28,900 🟢 +9.7%
strings.js — Interp: 🟢 9, 2 unch. · avg +11.3% · Bytecode: 11 unch. · avg -1.9%
Benchmark Interpreted Δ Bytecode Δ
string concatenation 511,478 → 489,440 -4.3% 400,198 → 396,530 -0.9%
template literal 420,810 → 449,745 +6.9% 687,666 → 642,353 -6.6%
string repeat 413,010 → 489,155 🟢 +18.4% 915,304 → 914,826 -0.1%
split and join 150,058 → 169,609 🟢 +13.0% 262,111 → 254,177 -3.0%
indexOf and includes 170,604 → 189,784 🟢 +11.2% 535,368 → 524,107 -2.1%
toUpperCase and toLowerCase 258,982 → 287,416 🟢 +11.0% 662,911 → 644,980 -2.7%
slice and substring 163,324 → 186,117 🟢 +14.0% 608,637 → 590,873 -2.9%
trim operations 195,121 → 214,672 🟢 +10.0% 710,661 → 704,834 -0.8%
replace and replaceAll 214,622 → 246,033 🟢 +14.6% 592,980 → 595,234 +0.4%
startsWith and endsWith 135,159 → 155,061 🟢 +14.7% 469,533 → 471,956 +0.5%
padStart and padEnd 204,549 → 235,479 🟢 +15.1% 542,784 → 531,183 -2.1%
typed-arrays.js — Interp: 🟢 21, 1 unch. · avg +12.4% · Bytecode: 🟢 1, 21 unch. · avg +1.6%
Benchmark Interpreted Δ Bytecode Δ
new Int32Array(0) 335,936 → 372,783 🟢 +11.0% 122,121 → 124,272 +1.8%
new Int32Array(100) 310,843 → 345,255 🟢 +11.1% 120,907 → 119,287 -1.3%
new Int32Array(1000) 159,219 → 171,160 🟢 +7.5% 91,155 → 95,953 +5.3%
new Float64Array(100) 262,697 → 267,638 +1.9% 115,969 → 115,892 -0.1%
Int32Array.from([...]) 184,485 → 213,398 🟢 +15.7% 62,587 → 62,822 +0.4%
Int32Array.of(1, 2, 3, 4, 5) 327,107 → 363,796 🟢 +11.2% 233,329 → 238,527 +2.2%
sequential write 100 elements 3,989 → 4,472 🟢 +12.1% 12,345 → 12,611 +2.2%
sequential read 100 elements 4,186 → 4,513 🟢 +7.8% 9,754 → 10,057 +3.1%
Float64Array write 100 elements 3,665 → 4,215 🟢 +15.0% 11,632 → 11,959 +2.8%
fill(42) 44,957 → 53,547 🟢 +19.1% 43,299 → 45,306 +4.6%
slice() 213,823 → 245,382 🟢 +14.8% 182,002 → 184,776 +1.5%
map(x => x * 2) 8,747 → 9,914 🟢 +13.3% 7,141 → 7,383 +3.4%
filter(x => x > 50) 8,773 → 10,022 🟢 +14.2% 7,410 → 7,395 -0.2%
reduce (sum) 8,409 → 9,369 🟢 +11.4% 6,368 → 6,210 -2.5%
sort() 175,708 → 205,048 🟢 +16.7% 153,249 → 148,370 -3.2%
indexOf() 440,957 → 522,947 🟢 +18.6% 338,326 → 343,936 +1.7%
reverse() 332,891 → 382,730 🟢 +15.0% 262,263 → 267,139 +1.9%
create view over existing buffer 420,223 → 459,082 🟢 +9.2% 132,086 → 131,949 -0.1%
subarray() 466,958 → 538,592 🟢 +15.3% 339,375 → 345,740 +1.9%
set() from array 578,482 → 653,802 🟢 +13.0% 239,555 → 239,600 +0.0%
for-of loop 5,709 → 6,239 🟢 +9.3% 18,185 → 18,737 +3.0%
spread into array 20,811 → 22,932 🟢 +10.2% 62,136 → 66,733 🟢 +7.4%

Measured on ubuntu-latest x64. Changes within ±7% are considered insignificant.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant