Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
call vs [method] vs direct
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
call
3323234.5 Ops/sec
[method]
4200808.0 Ops/sec
direct
4194534.5 Ops/sec
Script Preparation code:
var object = { count: 0, sum: function(value) { this.count += value; } }; function one(value, method) { method.call(object, value); } function two(value, method) { object[method](value); } function three(value) { object.sum(value); }
Tests:
call
count = 0; one(10.5, object.sum);
[method]
count = 0; two(10.5, "sum");
direct
count = 0; three(10.5);