Class Instantiation Speed (v2)

Revision 2 of this benchmark created on


Setup

class DepClass {
	duck() {
		console.log("Ducking")
	}
}
class FooBar {
	constructor() {
		this.dep = new DepClass();
	}
	baz () {
		this.dep.duck()
	}
}


const initialized = new FooBar();

Test runner

Ready to run.

Testing in
TestOps/sec
Already Initialized
initialized.dep = new DepClass()
initialized.baz()
ready
Init and call
const init = new FooBar();
init.baz()
ready

Revisions

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