Latest Benchmarks

Browse the latest JavaScript performance benchmarks created by the community.

String concatenation vs array join [previous author fucked up]

No description provided

Another array[len - 1] vs array.at(-1)

No description provided

Wtf why is the last one fastest?!

What is going on?!

JavaScript spread operator vs Object.assign performance reassign same variable 2

No description provided

property access: object with define property vs Proxy get vs plain object 2

No description provided

property access: object with define property vs Proxy get vs plain object

No description provided

property access: object with define property vs Proxy get

No description provided

querySelectorAll vs getElementsByTagName iteration2

No description provided

Array: [] vs at()

No description provided

Switch vs Object Literals - Speed Test

No description provided

Observables: loops with try/catch versus EventTarget

When the “observable” pattern is implemented in JavaScript, it's practically always done using a loop over callbacks. One problem with this approach is that an exception in one handler will crash the entire loop. You can work around this by wrapping the invocation in a try/catch block, but in doing so, you silently swallow the error. The browser provides an event dispatcher for DOM elements that runs each handler in a separate execution context, providing a better failure mode for independent listeners. `EventTarget` is an interface, so you can't directly instantiate one. But you can hijack the `EventTarget` implementation from a dummy object. This test compares multi-listener dispatches using loops and the built-in `EventTarget`. My expectation is that the native mechanism will carry some overhead, partly because of the bespoke execution context, and partly because of the extra properties instantiated on each `CustomEvent` instance. This method also has to look up events by their (string) names, rather than using direct object reference. See http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/

function versus const arrow function

No description provided

string comparison test localeCompare

No description provided

double-bang-vs-boolean-cast-multiple-types

!!x vs Boolean(x)

fromEntries vs reduce fight!

No description provided

2D to 1D Test

No description provided

Benchmark Reduce vs Concat vs Join

No description provided

Benchmark Reduce vs Concat

No description provided

push vs length as filter (2)

No description provided

push vs length as filter

No description provided

push vs length

No description provided

Array combination by destructuring vs concat()

Test how a couple of succesive object array concatenations perform.

Destructuring array iterator vs array iterator keys

No description provided

Mapping a ranged value array v1

Creates objects based on a specific range of values, to be used as values within the mapped object.

Ranged array mapping

No description provided