Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

JavaScript string split vs match using regex

No description provided

Array.find vs. Map.getss

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

pop() vs array.length -= 1

No description provided

hypot vs. sqrt

Math.hypot vs Math.sqrt

Spread vs Object.assign vs Object.create

No description provided

Array isArray vs typeof with string

Is typeof or isArray faster for detecting if something is an array or strings or a single string

MMP Reverse Array

No description provided

Linked List Queue vs Double Array Queue vs Queue with Map enqueue/dequeue/dequeueTail

Testing a linked list queue vs a double list queue vs Queue with Map for different performance scenarios.

isFinite vs is undefined

No description provided

sort vs toSorted vs spread-and-sort vs just-spread

No description provided

bit shift vs divide by 2

No description provided

&& vs optional chaining vs nothing

How to better null-check

.createElement() vs .createHTMLDocument() vs DOMParser() vs .appendChild()

Test performance between using document.createElement(), document.createHTMLDocument(), DOMParser(), and building up a DOM tree with .appendChild()

pop() vs shift() vs unshift vs pop vs index

No description provided

Loop vs Stringify Array Comparison

No description provided

Shorten array -- slice vs filter

No description provided

moment.js parse vs parseZone vs new Date for iso 8601 date

No description provided

Recursive reduce vs recursive flatMap

No description provided

Case insensitive search: regex.test() vs string.toLowerCase().includes()

No description provided

removeChild vs display="none" performance benchmark

This benchmark is a fork of a different one. This time, using a different way to iterate childs for display:none. I was worried the original benchmark was not being fair.

Custom replacement in string

No description provided

array.some vs regex.test

No description provided

number to string js

No description provided

Function constructor (2)

Constructing a Function() by passing args into the constructor or generated method

scrollHeight vs getBoundingClientRect().height

No description provided

NEW BENCHMARK Your Benchmarks