Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/110.0.5481.114 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 110
iOS 16.1
Mobile
one year ago
Test name Executions per second
original 1152.3 Ops/sec
ES5 replace match map 825.3 Ops/sec
match without replace 1347.6 Ops/sec
iteration with replace 632.7 Ops/sec
looping with exec 870.4 Ops/sec
non regex 7438.2 Ops/sec
Script Preparation code:
Tests:
  • original

  • ES5 replace match map

  • match without replace

  • iteration with replace

  • looping with exec

  • non regex


;