something with packing ints

JavaScript performance comparison

Test case created by Arnor

Preparation code

Benchmark.prototype.setup = function() {
    var pack = function(x,y) { return x | y << 16; }

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
looking up an object hash
var newVar = {x: 1337, y: 1337};

var x = newVar.x,
    y = newVar.y;
packing an int and reading it
var newVar = pack(1337, 1337);

var x = newVar & 0xffff,
    y = ((newVar & 0xffff0000) >>> 16);

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment