empty object vs function with null prototype

Benchmark created on


Setup

function EmptyObject() {}
EmptyObject.prototype = Object.create(null);

Test runner

Ready to run.

Testing in
TestOps/sec
empty constructor
const obj = new EmptyObject();
ready
empty object
const obj = Object.create(null);
ready

Revisions

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