Script Preparation code:
AخA
 
var string = "HelloWorld!".repeat(100) + " Hi";
Tests:
  • Concat

     
    for (let i = 0; i < 200; ++i) {
      let result = '';
      for (let j = 0; j < string.length; ++j) {
        if (' ' === string[j]) {
          break;
        }
        result += string[j];
      }
    }
  • Find & Substring

     
    for (let i = 0; i < 200; ++i) {
      let j;
      for (j = 0; j < string.length; ++j) {
        if (' ' === string[j]) {
          break;
        }
      }
      let result = string.substring(0, j);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Concat
    Find & Substring

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Concat 27.3 Ops/sec
Find & Substring 41.2 Ops/sec