Run details:
Mozilla/5.0 (Linux; Android 12; 2107113SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36
Chrome Mobile 103
Android
Mobile
2 years ago
Test name Executions per second
Regex 280828.2 Ops/sec
For loop, ParseInt 519959.3 Ops/sec
For loop with switch case 468831.3 Ops/sec
For loop, toString 861690.1 Ops/sec
Script Preparation code:
Tests:
  • Regex and Loop

  • For loop, ParseInt

  • For loop with switch case

  • For loop, toString

  • Pure Regex