Script Preparation code:
Tests:
  • lorem.startsWith("L");

  • lorem.indexOf("L") === 0;

  • LOREM_RE.test(lorem);

  • lorem.startsWith("R");

  • lorem.indexOf("R") === 0;

  • ROLEM_RE.test(lorem);

  • lorem && lorem[0] === "L";

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    lorem.startsWith("L");
    lorem.indexOf("L") === 0;
    LOREM_RE.test(lorem);
    lorem.startsWith("R");
    lorem.indexOf("R") === 0;
    ROLEM_RE.test(lorem);
    lorem && lorem[0] === "L";

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111 on Windows
View result in a separate tab
Test name Executions per second
lorem.startsWith("L"); 19701126.0 Ops/sec
lorem.indexOf("L") === 0; 20596980.0 Ops/sec
LOREM_RE.test(lorem); 8627034.0 Ops/sec
lorem.startsWith("R"); 20186576.0 Ops/sec
lorem.indexOf("R") === 0; 20728834.0 Ops/sec
ROLEM_RE.test(lorem); 9000487.0 Ops/sec
lorem && lorem[0] === "L"; 10217614.0 Ops/sec