Class vs POJO (v3)

Revision 3 of this benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
Class
for (let i = 0; i < 1000; i++) {
	const instance = new Klass();
	instance.test();
}
ready
POJO
for (let i = 0; i < 1000; i++) {
	const instance = createPojo();
	instance.test();
}
ready

Revisions

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