Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

Count Array Duplicates

No description provided

Perf difference when using looping over collection vs creating a cached projection for that access pattern (large array)

Intent is to measure the benefit of creating multiple "cache projections" (for lack of a better name) when using Redux Toolkit's EntityAdapter. It already handles everything in an "entities" object (keys are ids, values are the entity) and manages a list of ids separately. If we want to access a specific item based on the value of another key on that object, we are forced to loop through all the entities (either with Object.keys, Object.values, a for..in, or using the ids list) to find it. The solution tested here is to maintain another object that's simply a mapping between the key we want to look for and the id of the corresponding object for fast access. It is obviously faster, but by how much?

Perf difference when using looping over collection vs creating a cached projection for that access pattern (medium array)

Intent is to measure the benefit of creating multiple "cache projections" (for lack of a better name) when using Redux Toolkit's EntityAdapter. It already handles everything in an "entities" object (keys are ids, values are the entity) and manages a list of ids separately. If we want to access a specific item based on the value of another key on that object, we are forced to loop through all the entities (either with Object.keys, Object.values, a for..in, or using the ids list) to find it. The solution tested here is to maintain another object that's simply a mapping between the key we want to look for and the id of the corresponding object for fast access. It is obviously faster, but by how much?

Map vs Object: Full benchmark

Lookup of map vs object

Perf difference when using looping over collection vs creating a cached projection for that access pattern (small array)

Intent is to measure the benefit of creating multiple "cache projections" (for lack of a better name) when using Redux Toolkit's EntityAdapter. It already handles everything in an "entities" object (keys are ids, values are the entity) and manages a list of ids separately. If we want to access a specific item based on the value of another key on that object, we are forced to loop through all the entities (either with Object.keys, Object.values, a for..in, or using the ids list) to find it. The solution tested here is to maintain another object that's simply a mapping between the key we want to look for and the id of the corresponding object for fast access. It is obviously faster, but by how much?

Perf difference when using find on collection vs creating a cached projection for that access pattern

Intent is to measure the benefit of creating multiple "cache projections" (for lack of a better name) when using Redux Toolkit's EntityAdapter. It already handles everything in an "entities" object (keys are ids, values are the entity) and manages a list of ids separately. If we want to access a specific item based on the value of another key on that object, we are forced to loop through all the entities (either with Object.values, a for..in or using the ids list) to find it. The solution tested here is to maintain another object that's simply a mapping between the key we want to look for and the id of the corresponding object for fast access.

.find() vs direct access in object by id

No description provided

bfbcvbvbbv

bvbvcbvvb

Replace_12211fd

No description provided

asdasdasdasdad

No description provided

Closure vs non-closure

No description provided

Vanilla JS VS JQuery 3.6.0 DOM perfomance

Vanilla JS VS JQuery 3.6.0 DOM perfomance

testingggs3

No description provided

array.prototype.at() vs array[array.length - 1]

which one is faster for reaching last item of an array

lodash vs arr

No description provided

array include vs set has

array include vs set has

_.uniqBy vs myUniqBy

_.uniqBy vs myUniqBy

Assignment of values vs Destructuring an object of multiple values

No description provided

test regex vs loop

test regex vs loop

prefix trimming techniques

No description provided

slice vs substr vs substring (with no end index)222

Compares slice, substr and substring to each other when there is only a start index

slice vs substr vs substring (with no end index)22

Compares slice, substr and substring to each other when there is only a start index

slice vs substr vs substring (with no end index)2

Compares slice, substr and substring to each other when there is only a start index

Object cloning with Lodash clone vs ES6 object spread vs ES6 Object.assign vs Json copy

No description provided

Lodash cloneDeep vs JSON Clone vs structuredClone

No description provided