Tests:
  • Passing Objects

    x
     
    var sprite = {x: 14, y: -20, width: 26};
    var cage = {x: 66, y: 79};
    var radius = 28;
    function matrix(a, b, c) {
      var x = ((a.x - b.x) / c) * (c - a.width);
      var y = ((a.y - b.y) / c) * (c - a.width);
      return {x: x, y: y};
    }
    matrix(sprite, cage, radius);
  • Passing Parameters

     
    var sprite = {x: 14, y: -20, width: 26};
    var cage = {x: 66, y: 79};
    var radius = 28;
    function matrix(a, b, c, d, e, f) {
      var x = ((a - d) / f) * (f - c);
      var y = ((b - e) / f) * (f - c);
      return {x: x, y: y};
    }
    matrix(sprite.x, sprite.y, sprite.width, cage.x, cage.y, radius);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Passing Objects
    Passing Parameters

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.7 (KHTML, like Gecko) Version/9.1.2 Safari/601.7.7
Safari 9 on Mac OS X 10.11.6
View result in a separate tab
Test name Executions per second
Passing Objects 18458056.0 Ops/sec
Passing Parameters 159775040.0 Ops/sec