Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object passing vs shared array context.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Browser:
Chrome 123
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Using Object
2753099.8 Ops/sec
Using shared context
1626143.8 Ops/sec
Script Preparation code:
var ctx = new Array(2); function addObject(obj) { return obj.a + obj.b; } function addCtx() { return ctx[0] + ctx[1]; }
Tests:
Using Object
addObject({ a: Math.random(), b: Math.random() });
Using shared context
ctx[0] = Math.random(); ctx[1] = Math.random(); addCtx();