Arguments vs object (v3)

Revision 3 of this benchmark created on


Setup

function sumArgs(a, b, c, d) { return a + b + c + d }

function sumObj({a, b, c, d}) { return a + b + c + d }

Test runner

Ready to run.

Testing in
TestOps/sec
Arguments
sumArgs(Math.random(), Math.random(), Math.random(), Math.random())
ready
Object 1
sumObj({ a: Math.random(), b: Math.random(), c: Math.random(), d: Math.random(), })
ready
Object 2
sumObj({ c: Math.random(), d: Math.random(), b: Math.random(), a: Math.random() })
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.