Creation of class vs POJO (v2)

Revision 2 of this benchmark created on


Setup

const SIZE = 1000;
const classes = new Array(SIZE);
const pojos = new Array(SIZE);

class Klass {
	test() {
		return;
	}
}

function createPojo() {
	return {
		test() {
			return;
		}
	}
}

Test runner

Ready to run.

Testing in
TestOps/sec
Class
for (let i = 0; i < SIZE; i++) {
	classes[i] = new Klass()
}
ready
POJO
for (let i = 0; i < SIZE; i++) {
	pojos[i] = createPojo()
}
ready

Revisions

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