List of objects (v4)

Revision 4 of this benchmark created on


Setup

function myObjFn() {}

function createObj(name) {
	return { name, value: 12 }
}

function createObjWithFunc(name) {
	return { name, foo: myObjFn }
}

class Foo {
	constructor(name) {
		this.name = name
	}
	
	bar() {}
}

Test runner

Ready to run.

Testing in
TestOps/sec
list of objects 1
[
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject"),
	createObj("MyObject")
]
ready
list of objects 2
[
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' },
	{ foo: myObjFn, name: 'bar' }
]
ready
list of objects 3
[
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject"),
	createObjWithFunc("MyObject")
]
ready
list of instances
[
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance")
]
ready

Revisions

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