object literal vs object create

Benchmark created on


Setup

var literalHash = { "foo": "bar" },
        createHash = Object.create(null);
    createHash["foo"] = "bar";

Test runner

Ready to run.

Testing in
TestOps/sec
literal-hit
literalHash.foo
ready
literal-miss
literalHash.unk
ready
literal-in-hit
"foo" in literalHash
ready
literal-in-miss
"unk" in literalHash
ready
obj-create-hit
createHash.foo
ready
obj-create-miss
createHash.unk
ready
obj-in-hit
"foo" in createHash
ready
obj-in-miss
"unk" in createHash
ready

Revisions

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