Script Preparation code:
Tests:
  • Regex match count

  • Get replaced text length with regex

  • Get replaced text length with String.replaceAll()

  • Get replaced text length with String.split()

  • Calculate with String.split()

  • Calculate in simple for loop

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Regex match count
    Get replaced text length with regex
    Get replaced text length with String.replaceAll()
    Get replaced text length with String.split()
    Calculate with String.split()
    Calculate in simple for loop

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.57
Chrome 110 on Windows
View result in a separate tab
Test name Executions per second
Regex match count 959190.9 Ops/sec
Get replaced text length with regex 1961361.0 Ops/sec
Get replaced text length with String.replaceAll() 2762523.0 Ops/sec
Get replaced text length with String.split() 2737454.0 Ops/sec
Calculate with String.split() 3998123.0 Ops/sec
Calculate in simple for loop 187175.3 Ops/sec