Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Nesting of functions in JavaScript
Nesting of functions in JavaScript
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/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
nesting of function
5K/s
none nesting of function
4K/s
View exact numbers
Test name
Executions per second
✓
nesting of function
4,526 Ops/sec
none nesting of function
3,534 Ops/sec
Script Preparation code:
var func1 = function() { var innerf = function (callback) { return callback(); } return innerf(Math.random); } var innerff = function(callback) { return callback(); } var func2 = function() { return innerff(Math.random); }
Tests:
nesting of function
for (let i = 0; i < 1000; i++) { func1(); }
none nesting of function
for (let i = 0; i < 1000; i++) { func2(); }