zlib-comparison-text-1musk10

JavaScript performance comparison

Revision 3 of this test case created by imaya

Preparation code

<script src="https://raw.github.com/imaya/zlib-comparison/master/data/1musk10.txt.js"></script>

<script src="https://raw.github.com/imaya/zlib-comparison/master/zlib.js/inflate.min.js"></script>
<script src="https://raw.github.com/imaya/zlib-comparison/master/zlib.js/inflate_stream.min.js"></script>

<script src="https://raw.github.com/imaya/zlib-comparison/master/zlib-js/zlib.js"></script>
<script src="https://raw.github.com/imaya/zlib-comparison/master/zlib-js/zlib-inflate.js"></script>


<script src="https://raw.github.com/imaya/zlib-comparison/master/zpipe/zpipe.min.js"></script>

<script src="https://raw.github.com/imaya/zlib-comparison/master/pdf.js/stream.js"></script>

<script src="https://raw.github.com/imaya/zlib-comparison/master/jsziptools/dataview.min.js"></script>
<script src="https://raw.github.com/imaya/zlib-comparison/master/jsziptools/jsziptools.min.js"></script>

<script>
var dataArray = toArray(data);

if (typeof Uint8Array === 'function') {
  dataArray = new Uint8Array(dataArray);
}

function toArray(str) {
  var i;
  var il;
  var array = new Array(str.length);

  for (i = 0, il = str.length; i < il; ++i) {
    array[i] = str.charCodeAt(i);
  }

  return array;
}
</script>
    

Preparation code output

<script src="https://raw.github.com/imaya/zlib-comparison/master/zlib.js/inflate.min.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/zlib.js/inflate_stream.min.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/zlib-js/zlib.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/zlib-js/zlib-inflate.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/zpipe/zpipe.min.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/pdf.js/stream.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/jsziptools/dataview.min.js"></script> <script src="https://raw.github.com/imaya/zlib-comparison/master/jsziptools/jsziptools.min.js"></script> <script> var dataArray = toArray(data); if (typeof Uint8Array === 'function') { dataArray = new Uint8Array(dataArray); } function toArray(str) { var i; var il; var array = new Array(str.length); for (i = 0, il = str.length; i < il; ++i) { array[i] = str.charCodeAt(i); } return array; } </script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
zlib.js
new Zlib.Inflate(dataArray).decompress();

pending…
zlib.js(stream)
new Zlib.InflateStream().decompress(dataArray);
pending…
iz-zlib
ZLIB.inflateInit().inflate(data);
pending…
pdf.js
new FlateStream(new Stream(dataArray)).getBytes();
pending…
jsziptools
jz.zlib.decompress(dataArray);
pending…
zpipe
zpipe.inflate(data);
pending…

Compare results of other browsers

Revisions

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

0 Comments