keys v for-in

Benchmark created on


Setup

variables = {
	test: 1,
	blah: "two"
}
payload = { 
	test: 3,
	blah: "four"
}

Test runner

Ready to run.

Testing in
TestOps/sec
keys
Object.keys(variables).every((key) => {  	 
  return payload[key] === variables[key];
});
ready
for-in
matches = true
for (k in variables) {
  if (payload[k] !== variables[k]) {
  	matches = false
  	break
  }
}
ready

Revisions

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