Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
direct
322.6M/s
call
317.7M/s
[method]
315.8M/s
View exact numbers
Test name
Executions per second
✓
direct
322,568,704 Ops/sec
call
317,657,184 Ops/sec
[method]
315,774,944 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);