lambda vs. prototype

Benchmark created on


Setup

class Foo
{
	bar() {
		return 100;
	}
}

const barLambda = (foo) => foo.bar();
const barPrototype = Foo.prototype.bar;

const foo = new Foo();

Test runner

Ready to run.

Testing in
TestOps/sec
lambda
barLambda(foo)
ready
prototype
barPrototype.call(foo)
ready

Revisions

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