Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Inlining
(version: 0)
Comparing performance of:
function vs inline
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var n = 1e9; var a = new Uint32Array(n);
Tests:
function
function fn(i) { return a[i] } let x = 0; for(let i = 0; i < n; i++) { x += fn(i); } console.log(x);
inline
let x = 0; for(let i = 0; i < n; i++) { x += a[i]; } console.log(x);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
function
inline
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Shifting array elements
UInt8Array vs cast to array index access
JS number to UInt8Array 64-bit little endian
JS number to UInt8Array 64-bit little endian 2
BigIntArray
Comments
Confirm delete:
Do you really want to delete benchmark?