GC-performance
JavaScript performance comparison
Preparation code
<script>
window.Vector = function(x,y) {
this.x = x;
this.y = y;
};
Vector.prototype.copy = function () {
return new Vector(x, y);
};
Vector.prototype.set(vec) {
this.x = vec.x;
this.y = vec.y;
};
Vector.prototype.scale(num) {
this.x *= num;
this.y *= num;
return this;
};
</script>
<script>
Benchmark.prototype.setup = function() {
var tmp = new Vector(0, 0);
var momentum = new Vector(0, 0);
var velocity = new Vector(0, 0);
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
copy |
|
pending… |
helper |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments