Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
invoke bound function vs invoke closure
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 10; Mobile; rv:128.0) Gecko/128.0 Firefox/128.0
Browser:
Firefox Mobile 128
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Benchmark engine:
Benchmark.js
invoke closure
21.9M/s
invoke bound
4.9M/s
invoke boundThis
4.8M/s
View exact numbers
Test name
Executions per second
✓
invoke closure
21,851,992 Ops/sec
invoke bound
4,869,898 Ops/sec
invoke boundThis
4,846,871 Ops/sec
Script Preparation code:
var a = {v : Math.random()} var bound = (function(a_) { a_.v = Math.imul(2, a_.v); }).bind(null, a); var boundThis = (function() { this.v = Math.imul(2, this.v); }).bind(a); var closure = (function() { const a_ = a; return function() { a_.v = Math.imul(2, a_.v); }; })();
Tests:
invoke bound
bound();
invoke closure
closure();
invoke boundThis
boundThis();