Script Preparation code:
Tests:
  • Regular Expression Literal:

  • split and join

  • Regular Expression:

  • while replace includes

  • while replace indexOf

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Regular Expression Literal:
    split and join
    Regular Expression:
    while replace includes
    while replace indexOf

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Regular Expression Literal: 8927917.0 Ops/sec
split and join 6070086.0 Ops/sec
Regular Expression: 4984785.5 Ops/sec
while replace includes 17430994.0 Ops/sec
while replace indexOf 17279666.0 Ops/sec