Objects 2

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
slow
function addProperty(obj, propName, value) {
  obj[propName] = value; // This changes the shape of the object
}
const responseObject = { user1: 1, user2: 2 };
addProperty(responseObject, 'user3', 3); // Adding a new property
ready
fast
function createObject(a, b, c) {
// The shape of the object is fixed and predictable to the VM
  return { a, b, c };
}
const dataObject = createObject(212,2344,43545);
ready

Revisions

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