Test calls perfs

Benchmark created on


Setup

let A;

function foo(a) {
	A = a
}

let FOO = Symbol()

class B {}
B.prototype.foo = foo;
B.prototype[FOO] = foo;

b = new B();

Test runner

Ready to run.

Testing in
TestOps/sec
Function
for(let i = 0; i < 1000; ++i)
foo(i)
ready
Method call
for(let i = 0; i < 1000; ++i)
b.foo(i);
ready
Method call from proto
for(let i = 0; i < 1000; ++i)
b.__proto__.foo(i);
ready
Method call from proto + symbol
for(let i = 0; i < 1000; ++i)
b.__proto__[FOO](i);
ready
Symbol method call
for(let i = 0; i < 1000; ++i)
b[FOO](i);
ready

Revisions

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