Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.7 Mobile/15E148 Safari/604.1
Mobile Safari 17
iOS 17.7
Mobile
3 months ago
Test name Executions per second
original 2049.3 Ops/sec
ES5 replace match map 1033.9 Ops/sec
match without replace 1881.7 Ops/sec
iteration with replace 983.1 Ops/sec
looping with exec 1110.2 Ops/sec
non regex 6823.9 Ops/sec
Script Preparation code:
Tests:
  • original

  • ES5 replace match map

  • match without replace

  • iteration with replace

  • looping with exec

  • non regex