map set fn vs class (v2)

Revision 2 of this benchmark created on


Setup

const map1 = new Map();
const map2 = new Map();

class Test{}
function creator(){
	return function(){};
}

Test runner

Ready to run.

Testing in
TestOps/sec
fn
for(let i = 0;i<100;i++){
	map1.set(creator(), 10);
}
map1.clear();
ready
class instance
for(let i = 0;i<100;i++){
	map2.set(new Test(), 10);
}
map2.clear();
ready

Revisions

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