Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93
Windows
Desktop
3 years ago
Test name Executions per second
Testing Regex, Length 1 38.7 Ops/sec
Testing Regex, Length 10 99.3 Ops/sec
Testing Regex, Length 100 586.4 Ops/sec
Testing Regex, Length 9 kB 567.7 Ops/sec
Testing Slice, Length 1 35.9 Ops/sec
Testing Slice, Length 10 402.4 Ops/sec
Testing Slice, Length 100 5782.4 Ops/sec
Testing Slice, Length 9 kB 553193.5 Ops/sec
Testing Substr, Length 1 36.4 Ops/sec
Testing Substr, Length 10 419.0 Ops/sec
Testing Substr, Length 100 5530.7 Ops/sec
Testing Substr, Length 9 kB 709876.9 Ops/sec
Script Preparation code:
Tests:
  • Testing Regex, Length 1

  • Testing Regex, Length 10

  • Testing Regex, Length 100

  • Testing Regex, Length 9 kB

  • Testing Slice, Length 1

  • Testing Slice, Length 10

  • Testing Slice, Length 100

  • Testing Slice, Length 9 kB

  • Testing Substr, Length 1

  • Testing Substr, Length 10

  • Testing Substr, Length 100

  • Testing Substr, Length 9 kB