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

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.1 Ops/sec
Get replaced text length with String.replaceAll() 2762523.2 Ops/sec
Get replaced text length with String.split() 2737453.8 Ops/sec
Calculate with String.split() 3998123.0 Ops/sec
Calculate in simple for loop 187175.3 Ops/sec