goog.math.Vec2 reset

Benchmark created by Kevin Moore on


Preparation HTML

<script src="http://localhost:9292/js/closure/closure/goog/base.js">
</script>

Setup

goog.require('goog.math.Vec2');

  Benchmark.prototype.setup = function() {
    goog.global.v = new goog.math.Vec2(0, 0);
  };

Test runner

Ready to run.

Testing in
TestOps/sec
Reset vector
goog.global.v = new goog.math.Vec2(0, 0);
ready
set properties directly
goog.global.v.x = 0;
goog.global.v.y = 0;
ready
Scale with 0
goog.global.v.scale(0);
ready

Revisions

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

  • Revision 1: published by Kevin Moore on