Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
startsWith positive 2902679.2 Ops/sec
indexOf positive 2353333.0 Ops/sec
lastIndexOf positive 2905907.5 Ops/sec
startsWith negative 3463315.5 Ops/sec
indexOf negative 1478005.5 Ops/sec
lastIndexOf negative 2850240.5 Ops/sec
substring positive 2055061.1 Ops/sec
substring negative 2184654.0 Ops/sec
Script Preparation code:
Tests:
  • startsWith positive

  • indexOf positive

  • lastIndexOf positive

  • startsWith negative

  • indexOf negative

  • lastIndexOf negative

  • substring positive

  • substring negative


;