Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

find vs fors

Testing the difference between native loops and find()

Javascript: Case insensitive string comparison (regex vs includes) with istantiating regexp per run, inline string regex, global regex

No description provided

Tuple vs Object vs Class V5

No description provided

Tuple vs Object vs Class V4

No description provided

toFixed vs toPrecision vs Math.round() vs Math.floorfast vs new Math.trunc 1 decimal

Comparing performance of: toFixed(4) vs toPrecision(4).toString() vs (Math.round(*10000)/10000).toString() vs Math.floor fast vs the new Math.trunc

shallow clone map vs clone object

No description provided

bigint 64 vs number

bigint vs number, 52 bits

Dates_Test

No description provided

coins task

No description provided

from vs split

No description provided

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