Object.keys vs Object.getOwnPropertyNames

Benchmark created on


Setup

var myObject = {
	"a": 1,
	"b": 2
}

var result = null

Teardown

console.log(result)

Test runner

Ready to run.

Testing in
TestOps/sec
Object.keys
result = Object.keys(myObject)
ready
Object.getOwnPropertyNames
result = Object.getOwnPropertyNames(myObject)
ready

Revisions

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