Immutable Array Mutations

Benchmark created on


Setup

const state = [2,4,8,0,32];

Test runner

Ready to run.

Testing in
TestOps/sec
with
const results = [ ];
for(let i = 0; i < 10000; i++)
{
	results.push( state.with( 3, i ) );
}
ready
classical
const results = [ ];
for(let i = 0; i < 10000; i++)
{
	const a = [...state];
	a[3] = i;
	results.push( a );
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.