List of objects (v2)

Revision 2 of this benchmark created on


Setup

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

function createObjWithFunc(name) {
	return { name, foo: () => {} }
}

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: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, name: 'bar' },
	{ foo: () => {}, 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.