simple object vs. parameters

Benchmark created on


Description

compare object passing vs. parameter passing

Setup

paramFunc(x, y) {
      return x + y;
    };
    
    objFunc(vec) {
      return vec.x + vec.y
    }

Test runner

Ready to run.

Testing in
TestOps/sec
pass parameter
var x = 5;
var y = 3;
var total = paramFunc(x, y);
ready
pass object
var xy = {x: 5, y: 3};
var total = objFunc(xy);
ready

Revisions

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