Script Preparation code:
AخA
 
var str = '11.04.09.100.98';
Tests:
  • Regex

     
    str.replace(/\.\d{1,3}$/, '')
  • Split and Join

     
    str.split('.').splice(0,3).join('.')
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Regex
    Split and Join

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Linux; Android 11; Mi A3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36
Chrome Mobile 95 on Android
View result in a separate tab
Test name Executions per second
Regex 1778194.0 Ops/sec
Split and Join 643555.2 Ops/sec