Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

String Search (HC)

No description provided

JS Regex vs .startsWith vs .indexOf vs contains longer strings

fork of https://www.measurethat.net/Benchmarks/Show/975/11/regex-vs-indexof-vs-startswith-vs-substr

get width

how to get width

slice vs substr vs substring (with end index) 847

Compares slice, substr and substring to each other when there is only a start index

Queue data structure

No description provided

Custom flat vs Array.flat (Array.flat wins)

No description provided

capitalize regExp vs join split

capitalize regExp vs join split

rest params vs arguments (rest params are fast)

No description provided

getTime() vs now()

No description provided

>>> vs >> vs << vs | vs Math.floorfast

No description provided

lodash pull vs native splice

No description provided

closest vs querySelector

Goal: Get the target element inside the DOM Test case #1 - You don't have the target id - Find a target element through DOM via Element.closest() Test case #2 - You have the target id from your state - Find the target element via Document.querySelector()

contains vs closest (actually working benchmark)

No description provided

for-of campare2

No description provided

Optinal property vs undefined value

No description provided

set.has vs. array.includes asdfasdfasdf

No description provided

set.has vs. array.includes asdfasdf

No description provided

count lines by indexOf and split

Compare counting lines by searching the EOLNs or by splitting the source to an array.

lodash flatmap vs array.flatMap fixed

No description provided

Is "startsWidth" actually worth it?

No description provided

URLSearchParams vs Custom

No description provided

for vs foreach vs some vs for..of(100,000,000)

Compare loop performance

for vs foreach vs some vs for..of(10,000)

Compare loop performance

big object undefined vs. typeof vs. in vs. hasOwnProperty

Object lookup performance

Lodash sortBy vs orderBy2

Lodash sortBy vs orderBy