Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36
Chrome Mobile 115
Android
Mobile
one year ago
Test name Executions per second
For Loop for item towards beginning 8656855.0 Ops/sec
While Loop for item towards beginning 8391179.0 Ops/sec
indexOf for item towards beginning 8945189.0 Ops/sec
For Loop for item towards end 4322152.5 Ops/sec
While Loop for item towards end 3487777.2 Ops/sec
indexOf for item towards end 4939556.0 Ops/sec
Script Preparation code:
Tests:
  • For Loop for item towards beginning

  • While Loop for item towards beginning

  • indexOf for item towards beginning

  • For Loop for item towards end

  • While Loop for item towards end

  • indexOf for item towards end