Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Chrome 101
Windows
Desktop
one year ago
Test name Executions per second
replace regex long string 199 spaces 89479.6 Ops/sec
replace All regex long string 199 spaces 84601.6 Ops/sec
replace regex short string 2 spaces 3925705.0 Ops/sec
replace All regex short string 2 spaces 1447263.0 Ops/sec
replace regex very long string 599 spaces 27753.0 Ops/sec
replace All regex very long string 599 spaces 26560.9 Ops/sec
Script Preparation code:
Tests:
  • replace regex long string 199 spaces

  • replace All regex long string 199 spaces

  • replace regex short string 2 spaces

  • replace All regex short string 2 spaces

  • replace regex very long string 599 spaces

  • replace All regex very long string 599 spaces