single filter vs many filters

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
single
const dupa = Array.from({ length: 10000 });

dupa.filter(x=> {
	return x===1 || x===2 || x===3;
});
ready
many
const dupa = Array.from({ length: 10000 });

dupa.filter(x=>x===1).filter(x=>x===2).filter(x=>x===3)
ready

Revisions

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