Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

lodash chunk vs splice

No description provided

foreach for vs promise.all for big arrays

No description provided

Reflect.has vs Direct Check

No description provided

stringify vs join vs tostring

No description provided

querySelector vs Loop v6

If you have a large number of elements, is it faster to use querySelectorAll, or to iterate over an array?

Bitwise vs pow

No description provided

const vs var vs let performance in loop

const vs var vs let performance in loop

Undefined vs null

No description provided

TextDecoder vs String.fromCharCode 2023

No description provided

ArrayBuffer encoding / decoding methods

Array.from() vs TextDecoder() and new Uint8Array() vs TextEncoder()

new Uint8Array() vs Uint8Array.from()

Test ArrayBuffer creation methods on a random Array

Assign once vs destructure twice

No description provided

Javascript Sort (numbers/strings)

Port from jsperf(https://jsperf.com/sorting-algorithms/58)

object-hash vs JSON.stringify

No description provided

Array.includes() vs Set.has()

No description provided

Array.find vs. Map.get

Test the performance of Array.find vs. Map.get, with various array sizes, and with/without conversion from array to map

Classnames vs CLSX @ 2023-02-15

No description provided

Decimal Rounding - Exponential notation vs Number.EPSILON vs Double rounding vs Double rounding v2

A benchmark for solutions that provide accurate decimal rounding, flooring, and ceiling to a specific number of decimal places. These solutions treat floats more like decimals by fixing the binary rounding issues to avoid unexpected results. Solution 1: converting the number to a string in the exponential notation (e.g., num + "e" + decimalPlaces). Solution 2: purely mathematical (Number.EPSILON) Solution 3: double rounding. This solution uses the Number.prototype.toPrecision() method to strip the floating-point round-off errors. Solution 4: double rounding v2. This solution is just like Solution 3, however it uses a custom toPrecision() function.

Spread&reduce vs flatMap vs reduce

No description provided

multiple shift vs splice

-

optionally chain me up on valentimes day

No description provided

Object.defineProperty vs Object.defineProperties

No description provided

TypedArray set() vs setter performance

No description provided

isEmpty vs .length benchmark

isEmpty empty array vs length empty array vs isEmpty array of strings vs length array of strings vs isEmpty array of objects vs length array of objects

Precompile RegExp vs Runtime (on the fly)

Is precompile version faster then on runtime? Function toSpacePascalCase() convert 'someTextWith333Digits' to 'Some Text With 333 Digits'

NEW BENCHMARK Your Benchmarks