Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69
Windows 7
Desktop
6 years ago
Test name Executions per second
Testing Regex, Length 1 33.0 Ops/sec
Testing Regex, Length 10 100.6 Ops/sec
Testing Regex, Length 100 243.0 Ops/sec
Testing Regex, Length 9 kB 302.7 Ops/sec
Testing Slice, Length 1 14.4 Ops/sec
Testing Slice, Length 10 79.4 Ops/sec
Testing Slice, Length 100 1513.4 Ops/sec
Testing Slice, Length 9 kB 139032.4 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