Run details:
Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4) Build/MPJ24.139-23.4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36
Chrome Mobile 52
Android 6.0.1
Moto G
8 years ago
Test name Executions per second
original 113.1 Ops/sec
ES5 replace match map 26.8 Ops/sec
match without replace 39.8 Ops/sec
iteration with replace 21.9 Ops/sec
looping with exec 43.9 Ops/sec
non regex 274.8 Ops/sec
Script Preparation code:
Tests:
  • original

  • ES5 replace match map

  • match without replace

  • iteration with replace

  • looping with exec

  • non regex