Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Windows
Desktop
2 years ago
Test name Executions per second
[MATCH] check str[i] before startsWith 50296240.0 Ops/sec
[MATCH] startsWith immediatly 51596100.0 Ops/sec
[NOT MATCH] check str[i] before startsWith 1406511000.0 Ops/sec
[NOT MATCH] startsWith immediatly 52832240.0 Ops/sec
[NOT MATCH] check too far str[i] before startsWith 6786487.0 Ops/sec
Script Preparation code:
Tests:
  • [MATCH] check str[i] before startsWith

  • [MATCH] startsWith immediatly

  • [NOT MATCH] check str[i] before startsWith

  • [NOT MATCH] startsWith immediatly

  • [NOT MATCH] check too far str[i] before startsWith