Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
match vs includes vs endsWith
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 YaBrowser/24.7.0.0 Safari/537.36
Browser:
Yandex Browser 24
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
match
211544.3 Ops/sec
includes
266516.0 Ops/sec
endsWith
283411.3 Ops/sec
Script Preparation code:
var names = [ ".b-island-header-content-is-style-loaded", ".b-island-header-content_island_top", ".b-island-header-content_island_bottom", ".b-island-header-content_island_all-sides", ".b-island-header-content__wrapper", ".b-island-header-content_display-bottom-island-padding_false .b-island-header-content__bottom-island", ".b-island-header-content__bottom-island" ];
Tests:
match
names.forEach((name) => { var matches = name.match(/^\.([\w-]+)-is-style-loaded$/); if (matches != null) { console.log(matches[1]); } });
includes
names.forEach((name) => { if (name.includes('-is-style-loaded')) { console.log(name.slice(0, name.length - '-is-style-loaded'.length)) } });
endsWith
names.forEach((name) => { if (name.endsWith('-is-style-loaded')) { console.log(name.slice(0, name.length - '-is-style-loaded'.length)) } });