Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
split-join
6.3M/s
replace with global regexp
5.1M/s
replaceAll
4.0M/s

Fastest: split-join (1.6x faster)

View exact numbers
  • split-join: 6,290,670 ops/sec
  • replace with global regexp: 5,088,056 ops/sec
  • replaceAll: 4,016,145 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    replace with global regexp
    replaceAll
    split-join

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
replace with global regexp
613.5M/s
split-join
15.1M/s
replaceAll
6.7M/s
View exact numbers
Test name Executions per second
replace with global regexp 613,535,872 Ops/sec
split-join 15,065,213 Ops/sec
replaceAll 6,661,378 Ops/sec