Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136
Mac OS X 10.15
Desktop
one year ago
conditionally trim and conditionally replace
3K/s
trim and conditionally replace with if
3K/s
trim and conditionally replace
3K/s
trim and always replace
2K/s
always replace and trim
2K/s
View exact numbers
Test name Executions per second
conditionally trim and conditionally replace 2,641 Ops/sec
trim and conditionally replace with if 2,608 Ops/sec
trim and conditionally replace 2,605 Ops/sec
trim and always replace 2,454 Ops/sec
always replace and trim 2,256 Ops/sec
Script Preparation code:
Tests: