Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

Slice vs Splice vs Shift single element

Compares the speed for removing 2 items from the beginning of an array

document.createElement() vs. document.createDocumentFragment()

No description provided

For-I vs For-of vs Reduce: Find the largest value in an array

A few of these cases are mostly to figure out how some changes impact optimisation. At the time of writing, each new test is based on the previous fastest test. So failed ideas don't reappear.

Javascript: reduce VS for with Math.max

Compare the "reduce" method with "for" iteration and "for-of" iteration. We try to find the maximum value in a list of number. I also added Math.max with the spread operator.

Math.pow(x,0.5) vs Math.sqrt(x) 2

No description provided

const vs let vs var asd

No description provided

reduce+concat vs. for loops

No description provided

getAttribute vs dataset 1002

Compare setAttribute to dataset

replace vs replaceAll (native)

No description provided

Array.toSpliced vs Array.filter

Test a speed difference between these 2 approaches

[0] vs .shift() with empty array

No description provided

[0] vs .shift()

No description provided

array map vs foreach push

No description provided

array from set vs lodash uniq

No description provided

eval vs json parse2

No description provided

Test add item from beggining vs end

No description provided

getElementById vs ParentElement.children

No description provided

willBeReplaced

No description provided

Array.prototype.slice vs spread operator performance

Compare the new ES6 spread operator with the traditional slice() method

innerHTML vs createElement

No description provided

Number.toLocaleString vs Intl.NumberFormat (single instance)

No description provided

JSON.stringify vs structuredClone vs cloneDeep 2

JSON.stringify vs structuredClone

JSON.stringify vs structuredClone vs cloneDeep

JSON.stringify vs structuredClone

Array concat vs spread operator benchmark

Compare the new ES6 spread operator with the traditional concat() method

for-in vs object.keys3

No description provided