Script Preparation code:
AخA
 
var a = [
    /@atlassian\/parcel/,
    /@parcel\//,
    /@oxc-resolver\/.+/,
];
var b = Object.freeze([
    /@atlassian\/parcel/,
    /@parcel\//,
    /@oxc-resolver\/.+/,
]);
Tests:
  • normal array

     
    for (const matcher of a) {
        if (matcher.test("SOMETHING")) { return 'yes'; }
        return 'no'
    }
  • frozen array

     
    for (const matcher of b) {
        if (matcher.test("SOMETHING")) { return 'yes'; }
        return 'no'
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    normal array
    frozen array

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Windows
View result in a separate tab
Test name Executions per second
normal array 11036072.0 Ops/sec
frozen array 8346339.5 Ops/sec