gameorderscompression2

JavaScript performance comparison

Test case created by Poch

Preparation code

<div id="test1">T1 : </div>
<br><br>
<div id="test2">T2 : </div>
<br><br>
<script>
Benchmark.prototype.setup = function() {
    var tickId = 999;
    var orders = "3ff";
};
</script>

Preparation code output

T1 :


T2 :


Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Classic JSONize
var dto = {i:tickId, o:orders};
var jsonDTO = JSON.stringify(dto);
jsonDTO = jsonDTO.replace(new RegExp('"', 'g'), "'");

if (!window.test1ResultDisplayed) {
      document.getElementById("test1").innerHTML += jsonDTO;
      window.test1ResultDisplayed = true;
}
pending…
Manual assembly
var dto = "["+tickId+",'"+orders+"']";

if (!window.test2ResultDisplayed) {
      document.getElementById("test2").innerHTML += dto;
      window.test2ResultDisplayed = true;
}
pending…

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

Compare results of other browsers

0 comments

Add a comment