Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

Object arrays: findIndex vs for loop (large array)

Testing finding an object array via findIndex or by using a for loop

Two objects Sort with compare

No description provided

Reuven findIndex benchmark

No description provided

string interpolation vs string concatenation vs [].join()

No description provided

structuredClone vs deepClone vs JSON in large objects

This benchmark creates huge objects to be cloned by lodash's cloneDeep function vs the native structuredClone

Lodash.js vs Native 117

Test

getAttribute vs dataset (for loop 1K)

Compare getAttribute with dataset

new Date instantiation performance

No description provided

replace string check

No description provided

Math.log2 vs division for power of two vs multiple of x vs max32

No description provided

Ways to copy an array

Reactive arrays cannot be completely changed in VueJS. We need to change the elements. Here are ways to do this without losing reactivity. The first test is a reference test and is not applicable for reactive arrays.

Largest multiple of number less than a uniform source size

No description provided

spread vs iterator for getting first element

No description provided

structuredClone vs spread vs Object.assign vs copy + more

Note!: none of these tests actually do the same thing, and the data in the example is simple. consider also using arrays: those are nice. Some of these are shallow, some of these are deep-ish. Data is lost through JSON serialization and back, and more data would be lost in JSON and other methods depending on the data stored.

Set Intersection using has and delete vs. Native Set Intersection

No description provided

Set Union using add vs. Native Set Union

No description provided

function typeof benchmark

No description provided

indexOf vs includes 1

No description provided

FP vs OOP formatting implementation

No description provided

clonedeep vs structuredclone vs jsonstringify parse

https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

body slector speed

No description provided

selector speed

No description provided

iterating through arrays (for .. of vs forEach) [noop in for of]

compare for ..of iteration speed with forEach method

iterating through arrays (for .. of vs forEach

compare for ..of iteration speed with forEach method

Escape HTML string tags in JavaScript

Escape HTML string tags in JavaScript by Character replacement vs. Tagged template literal function