jsPerf
Performance Report

Writing binary arrays – functions vs direct access

1.20×
Test with direct access faster than Test with functions
Apr 25, 2026by Kyle Reese
Leaderboard

Ops per second

  1. #1Test with direct access
    28.18M
  2. #2Test with functions
    23.39M

V8 Firecracker analysis · 2 tests

Winner

Test with direct access

Speed
28.18Mops/sec
1.20× ahead of Test with functions
Head to head

1.20× difference

Fastest
Test with direct access
28.18Mops/sec
Slowest
Test with functions
23.39Mops/sec
Runtimes

Across JS engines

Test with functions
bun@1.3.1317.13M
node@lts14.36M
node@25.9.012.86M
deno@2.7.139.64M
Test with direct access
bun@1.3.1319.61M
node@lts19.34M
node@25.9.018.06M
deno@2.7.1313.72M

Same code, different engines. Higher = faster.

JIT amplification

Optimizer boost

Test with functions13.2×
Memory-boundJIT-friendly
Test with direct access10×
Memory-boundJIT-friendly
Static complexity

Big-O from code structure

Setup is parsed for context, but the estimate scores only each benchmark test body.

Test with functions
90% confidence
O(1)O(1)

Only straight-line work or fixed-size operations were detected. No input-sized allocation was detected, so auxiliary space is estimated as constant. Setup symbols used as context: data, writeData, i.

Test with direct access
90% confidence
O(1)O(1)

Only straight-line work or fixed-size operations were detected. No input-sized allocation was detected, so auxiliary space is estimated as constant. Setup symbols used as context: data, writeData, i.

Memory response

Memory-limit sweep

Using QuickJS memory-limit profiles for allocation-pressure signals.

Test with functionsplateau
8 MB1.66M
16 MB1.77M
32 MB1.78M
64 MB1.78M

Model confidence: 93%

Test with direct accessplateau
8 MB2.79M
16 MB2.81M
32 MB2.74M
64 MB2.77M

Model confidence: 98%

Analyst's take

What the data means

The same test wins both with and without the JIT — the result is driven by genuine algorithmic differences.

Wins on paperWins in production
Test with direct access
Methodology

Where the data came from

Browser runs
42

Public benchmark executions used for leaderboard and environment breakdowns.

Controlled runtimes
4 engines

Node / Deno / Bun worker data across 8 single-core test-runtime pairs and 8 captured profiles.

Bun 1.3.1318.37M
2 tests · 2 profiles
Deno 2.7.1311.68M
2 tests · 2 profiles
Node.js 25.9.015.46M
2 tests · 2 profiles
Node.js lts16.85M
2 tests · 2 profiles
Top browsers
Chrome95%
Safari5%
Top operating systems
Mac OS76%
Windows14%
iOS5%
Android5%

Run it yourself.

Every benchmark on jsperf.net is reproducible — open source, hit Run.

Open source benchmark
Powered by jsperf.net · presentation reports are a donor perk.