Test name | Executions per second |
---|---|
normal array | 11036072.0 Ops/sec |
frozen array | 8346339.5 Ops/sec |
var a = [
/@atlassian\/parcel/,
/@parcel\//,
/@oxc-resolver\/.+/,
];
var b = Object.freeze([
/@atlassian\/parcel/,
/@parcel\//,
/@oxc-resolver\/.+/,
]);
for (const matcher of a) {
if (matcher.test("SOMETHING")) { return 'yes'; }
return 'no'
}
for (const matcher of b) {
if (matcher.test("SOMETHING")) { return 'yes'; }
return 'no'
}