class.prototype.method.call

Benchmark created on


Description

Call a class method

Setup

function ES5() {}
ES5.prototype.method = function() {
	return this.y;
}
let es5Instance = new ES5();

class ES6 {
	method() {
		return this.y;
	}
}
let es6Instance = new ES6();

let o = {y: 1};

Test runner

Ready to run.

Testing in
TestOps/sec
ES5 classes
ES5.prototype.method.call(o);
ready
ES5 class instances
es5Instance.method.call(o);
ready
ES6 classes
ES6.prototype.method.call(o);
ready
ES6 class instances
es6Instance.method.call(o);
ready

Revisions

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