Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Firefox 5 runs
String.prototype.replaceAll
548K/s
String.prototype.replace
541K/s
View exact numbers
  • String.prototype.replaceAll: 548,200 ops/sec
  • String.prototype.replace: 541,190 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
    String.prototype.replace
    String.prototype.replaceAll
    String.prototype.split
    Array.prototype.map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123 on Windows
View result in a separate tab
String.prototype.replace
560K/s
String.prototype.replaceAll
548K/s
String.prototype.split
522K/s
Array.prototype.map
174K/s
View exact numbers
Test name Executions per second
String.prototype.replace 560,344 Ops/sec
String.prototype.replaceAll 548,200 Ops/sec
String.prototype.split 522,349 Ops/sec
Array.prototype.map 174,364 Ops/sec