LZW vs plain text

JavaScript performance comparison

Test case created by Joshua Kehn

Info

Just a quick comparison

Preparation code

<script>
  /**
   $Id: Iuppiter.js 3026 2010-06-23 10:03:13Z Bear $
   
   Copyright (c) 2010 Nuwa Information Co., Ltd, and individual contributors.
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
   
   1. Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.
   
   2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
   
   3. Neither the name of Nuwa Information nor the names of its contributors
   may be used to endorse or promote products derived from this software
   without specific prior written permission.
   
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   
   $Author: Bear $
   $Date: 2010-06-23 18:03:13 +0800 (星期三, 23 六月 2010) $
   $Revision: 3026 $
   */

 
  if (typeof Iuppiter === 'undefined') Iuppiter = {
   version: '$Revision: 3026 $'.substring(11).replace(" $", ""),
  };
 
  /**
   * Convert string value to a byte array.
   *
   * @param {String} input The input string value.
   * @return {Array} A byte array from string value.
   */

  Iuppiter.toByteArray = function(input) {
   var b = [],
       i, unicode;
   for (i = 0; i < input.length; i++) {
    unicode = input.charCodeAt(i);
    // 0x00000000 - 0x0000007f -> 0xxxxxxx
    if (unicode <= 0x7f) {
     b.push(unicode);
     // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
    } else if (unicode <= 0x7ff) {
     b.push((unicode >> 6) | 0xc0);
     b.push((unicode & 0x3F) | 0x80);
     // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
    } else if (unicode <= 0xffff) {
     b.push((unicode >> 12) | 0xe0);
     b.push(((unicode >> 6) & 0x3f) | 0x80);
     b.push((unicode & 0x3f) | 0x80);
     // 0x00010000 - 0x001fffff -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
    } else {
     b.push((unicode >> 18) | 0xf0);
     b.push(((unicode >> 12) & 0x3f) | 0x80);
     b.push(((unicode >> 6) & 0x3f) | 0x80);
     b.push((unicode & 0x3f) | 0x80);
    }
   }
 
   return b;
  }
 
  /**
   * Base64 Class.
   * Reference: http://code.google.com/p/javascriptbase64/
   *            http://www.stringify.com/static/js/base64.js
   * They both under MIT License.
   */

  Iuppiter.Base64 = {
 
   /// Encoding characters table.
   CA: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
 
   /// Encoding characters table for url safe encoding.
   CAS: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
 
   /// Decoding reference table.
   IA: new Array(256),
 
   /// Decoding reference table for url safe encoded string.
   IAS: new Array(256),
 
   /**
    * Constructor.
    */

   init: function() {
    /// Initialize variables for Base64 namespace.
    var i;
 
    for (i = 0; i < 256; i++) {
     Iuppiter.Base64.IA[i] = -1;
     Iuppiter.Base64.IAS[i] = -1;
    }
 
    for (i = 0, iS = Iuppiter.Base64.CA.length; i < iS; i++) {
     Iuppiter.Base64.IA[Iuppiter.Base64.CA.charCodeAt(i)] = i;
     Iuppiter.Base64.IAS[Iuppiter.Base64.CAS.charCodeAt(i)] = i;
    }
 
    Iuppiter.Base64.IA['='] = Iuppiter.Base64.IAS['='] = 0;
   },
 
   /**
    * Encode base64.
    *
    * @param {Array|String} input A byte array or a string.
    * @param {Boolean} urlsafe True if you want to make encoded string is url
    *                          safe.
    * @return {String} Encoded base64 string.
    */

   encode: function(input, urlsafe) {
    var ca, dArr, sArr, sLen, eLen, dLen, s, d, left, i;
 
    if (urlsafe) ca = Iuppiter.Base64.CAS;
    else ca = Iuppiter.Base64.CA;
 
    if (input.constructor == Array) sArr = input;
    else sArr = Iuppiter.toByteArray(input);
 
    sLen = sArr.length;
 
    eLen = (sLen / 3) * 3; // Length of even 24-bits.
    dLen = ((sLen - 1) / 3 + 1) << 2; // Length of returned array
    dArr = new Array(dLen);
 
    // Encode even 24-bits
    for (s = 0, d = 0; s < eLen;) {
     // Copy next three bytes into lower 24 bits of int, paying attension to sign.
     i = (sArr[s++] & 0xff) << 16 | (sArr[s++] & 0xff) << 8 | (sArr[s++] & 0xff);
 
     // Encode the int into four chars
     dArr[d++] = ca.charAt((i >> 18) & 0x3f);
     dArr[d++] = ca.charAt((i >> 12) & 0x3f);
     dArr[d++] = ca.charAt((i >> 6) & 0x3f);
     dArr[d++] = ca.charAt(i & 0x3f);
    }
 
    // Pad and encode last bits if source isn't even 24 bits.
    left = sLen - eLen; // 0 - 2.
    if (left > 0) {
     // Prepare the int
     i = ((sArr[eLen] & 0xff) << 10) | (left == 2 ? ((sArr[sLen - 1] & 0xff) << 2) : 0);
 
     // Set last four chars
     dArr[dLen - 4] = ca.charAt(i >> 12);
     dArr[dLen - 3] = ca.charAt((i >> 6) & 0x3f);
     dArr[dLen - 2] = left == 2 ? ca.charAt(i & 0x3f) : '=';
     dArr[dLen - 1] = '=';
    }
 
    return dArr.join("");
   },
 
   /**
    * Decode base64 encoded string or byte array.
    *
    * @param {Array|String} input A byte array or encoded string.
    * @param {Object} urlsafe True if the encoded string is encoded by urlsafe.
    * @return {Array|String} A decoded byte array or string depends on input
    *                        argument's type.
    */

   decode: function(input, urlsafe) {
    var ia, dArr, sArr, sLen, bytes, sIx, eIx, pad, cCnt, sepCnt, len, d, cc, left, i, j, r;
 
    if (urlsafe) ia = Iuppiter.Base64.IAS;
    else ia = Iuppiter.Base64.IA;
 
    if (input.constructor == Array) {
     sArr = input;
     bytes = true;
    }
    else {
     sArr = Iuppiter.toByteArray(input);
     bytes = false;
    }
 
    sLen = sArr.length;
 
    sIx = 0;
    eIx = sLen - 1; // Start and end index after trimming.
    // Trim illegal chars from start
    while (sIx < eIx && ia[sArr[sIx]] < 0)
    sIx++;
 
    // Trim illegal chars from end
    while (eIx > 0 && ia[sArr[eIx]] < 0)
    eIx--;
 
    // get the padding count (=) (0, 1 or 2)
    // Count '=' at end.
    pad = sArr[eIx] == '=' ? (sArr[eIx - 1] == '=' ? 2 : 1) : 0;
    cCnt = eIx - sIx + 1; // Content count including possible separators
    sepCnt = sLen > 76 ? (sArr[76] == '\r' ? cCnt / 78 : 0) << 1 : 0;
 
    // The number of decoded bytes
    len = ((cCnt - sepCnt) * 6 >> 3) - pad;
    dArr = new Array(len); // Preallocate byte[] of exact length
    // Decode all but the last 0 - 2 bytes.
    d = 0;
    for (cc = 0, eLen = (len / 3) * 3; d < eLen;) {
     // Assemble three bytes into an int from four "valid" characters.
     i = ia[sArr[sIx++]] << 18 | ia[sArr[sIx++]] << 12 | ia[sArr[sIx++]] << 6 | ia[sArr[sIx++]];
 
     // Add the bytes
     dArr[d++] = (i >> 16) & 0xff;
     dArr[d++] = (i >> 8) & 0xff;
     dArr[d++] = i & 0xff;
 
     // If line separator, jump over it.
     if (sepCnt > 0 && ++cc == 19) {
      sIx += 2;
      cc = 0;
     }
    }
 
    if (d < len) {
     // Decode last 1-3 bytes (incl '=') into 1-3 bytes
     i = 0;
     for (j = 0; sIx <= eIx - pad; j++)
     i |= ia[sArr[sIx++]] << (18 - j * 6);
 
     for (r = 16; d < len; r -= 8)
     dArr[d++] = (i >> r) & 0xff;
    }
 
    if (bytes) {
     return dArr;
    }
    else {
     for (i = 0; i < dArr.length; i++)
     dArr[i] = String.fromCharCode(dArr[i]);
 
     return dArr.join('');
    }
   }
  };
 
  Iuppiter.Base64.init();
 
  (function() {
 
   // Constants was used for compress/decompress function.
   NBBY = 8, MATCH_BITS = 6, MATCH_MIN = 3, MATCH_MAX = ((1 << MATCH_BITS) + (MATCH_MIN - 1)), OFFSET_MASK = ((1 << (16 - MATCH_BITS)) - 1), LEMPEL_SIZE = 256;
 
   /**
    * Compress string or byte array using fast and efficient algorithm.
    *
    * Because of weak of javascript's natural, many compression algorithm
    * become useless in javascript implementation. The main problem is
    * performance, even the simple Huffman, LZ77/78 algorithm will take many
    * many time to operate. We use LZJB algorithm to do that, it suprisingly
    * fulfills our requirement to compress string fastly and efficiently.
    *
    * Our implementation is based on
    * http://src.opensolaris.org/source/raw/onnv/onnv-gate/
    * usr/src/uts/common/os/compress.c
    * It is licensed under CDDL.
    *
    * Please note it depends on toByteArray utility function.
    *
    * @param {String|Array} input The string or byte array that you want to
    *                             compress.
    * @return {Array} Compressed byte array.
    */

   Iuppiter.compress = function(input) {
    var sstart, dstart = [],
        slen, src = 0,
        dst = 0,
        cpy, copymap, copymask = 1 << (NBBY - 1),
        mlen, offset, hp, lempel = new Array(LEMPEL_SIZE),
        i, bytes;
 
    // Initialize lempel array.
    for (i = 0; i < LEMPEL_SIZE; i++)
    lempel[i] = 3435973836;
 
    // Using byte array or not.
    if (input.constructor == Array) {
     sstart = input;
     bytes = true;
    }
    else {
     sstart = Iuppiter.toByteArray(input);
     bytes = false;
    }
 
    slen = sstart.length;
 
    while (src < slen) {
     if ((copymask <<= 1) == (1 << NBBY)) {
      if (dst >= slen - 1 - 2 * NBBY) {
       mlen = slen;
       for (src = 0, dst = 0; mlen; mlen--)
       dstart[dst++] = sstart[src++];
       return dstart;
      }
      copymask = 1;
      copymap = dst;
      dstart[dst++] = 0;
     }
     if (src > slen - MATCH_MAX) {
      dstart[dst++] = sstart[src++];
      continue;
     }
     hp = ((sstart[src] + 13) ^ (sstart[src + 1] - 13) ^ sstart[src + 2]) & (LEMPEL_SIZE - 1);
     offset = (src - lempel[hp]) & OFFSET_MASK;
     lempel[hp] = src;
     cpy = src - offset;
     if (cpy >= 0 && cpy != src && sstart[src] == sstart[cpy] && sstart[src + 1] == sstart[cpy + 1] && sstart[src + 2] == sstart[cpy + 2]) {
      dstart[copymap] |= copymask;
      for (mlen = MATCH_MIN; mlen < MATCH_MAX; mlen++)
      if (sstart[src + mlen] != sstart[cpy + mlen]) break;
      dstart[dst++] = ((mlen - MATCH_MIN) << (NBBY - MATCH_BITS)) | (offset >> NBBY);
      dstart[dst++] = offset;
      src += mlen;
     } else {
      dstart[dst++] = sstart[src++];
     }
    }
 
    return dstart;
   };
 
   /**
    * Decompress string or byte array using fast and efficient algorithm.
    *
    * Our implementation is based on
    * http://src.opensolaris.org/source/raw/onnv/onnv-gate/
    * usr/src/uts/common/os/compress.c
    * It is licensed under CDDL.
    *
    * Please note it depends on toByteArray utility function.
    *
    * @param {String|Array} input The string or byte array that you want to
    *                             compress.
    * @param {Boolean} _bytes Returns byte array if true otherwise string.
    * @return {String|Array} Decompressed string or byte array.
    */

   Iuppiter.decompress = function(input, _bytes) {
    var sstart, dstart = [],
        slen, src = 0,
        dst = 0,
        cpy, copymap, copymask = 1 << (NBBY - 1),
        mlen, offset, i, bytes, get;
 
    // Using byte array or not.
    if (input.constructor == Array) {
     sstart = input;
     bytes = true;
    }
    else {
     sstart = Iuppiter.toByteArray(input);
     bytes = false;
    }
 
    // Default output string result.
    if (typeof(_bytes) == 'undefined') bytes = false;
    else bytes = _bytes;
 
    slen = sstart.length;
 
    get = function() {
     if (bytes) {
      return dstart;
     }
     else {
      // Decompressed string.
      for (i = 0; i < dst; i++)
      dstart[i] = String.fromCharCode(dstart[i]);
 
      return dstart.join('')
     }
    };
 
    while (src < slen) {
     if ((copymask <<= 1) == (1 << NBBY)) {
      copymask = 1;
      copymap = sstart[src++];
     }
     if (copymap & copymask) {
      mlen = (sstart[src] >> (NBBY - MATCH_BITS)) + MATCH_MIN;
      offset = ((sstart[src] << NBBY) | sstart[src + 1]) & OFFSET_MASK;
      src += 2;
      if ((cpy = dst - offset) >= 0) while (--mlen >= 0) dstart[dst++] = dstart[cpy++];
      else
  /*
                                 * offset before start of destination buffer
                                 * indicates corrupt source data
                                 */

      return get();
     } else {
      dstart[dst++] = sstart[src++];
     }
    }
 
    return get();
   };
 
  })();
 
 
  function lzw_encode(s) {
   var dict = {};
   var data = (s + "").split("");
   var out = [];
   var currChar;
   var phrase = data[0];
   var code = 256;
   for (var i = 1; i < data.length; i++) {
    currChar = data[i];
    if (dict[phrase + currChar] != null) {
     phrase += currChar;
    }
    else {
     out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0));
     dict[phrase + currChar] = code;
     code++;
     phrase = currChar;
    }
   }
   out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0));
   for (var i = 0; i < out.length; i++) {
    out[i] = String.fromCharCode(out[i]);
   }
   return out.join("");
  }
 
  // Decompress an LZW-encoded string
 
  function lzw_decode(s) {
   var dict = {};
   var data = (s + "").split("");
   var currChar = data[0];
   var oldPhrase = currChar;
   var out = [currChar];
   var code = 256;
   var phrase;
   for (var i = 1; i < data.length; i++) {
    var currCode = data[i].charCodeAt(0);
    if (currCode < 256) {
     phrase = data[i];
    }
    else {
     phrase = dict[currCode] ? dict[currCode] : (oldPhrase + currChar);
    }
    out.push(phrase);
    currChar = phrase.charAt(0);
    dict[code] = oldPhrase + currChar;
    code++;
    oldPhrase = phrase;
   }
   return out.join("");
  }
 
  function lzw_encode2(s) {
   var dict = {};
   data = s.split(""), out = [], phrase = data[0], code = 256, i = 1, l = data.length, currChar = null, ol = null, fcc = String.fromCharCode;
   for (i = 1; i < l; i++) {
    currChar = data[i];
    if (dict[phrase + currChar] != null) {
     phrase += currChar;
    }
    else {
 
     if (phrase.length > 1) {
      out.push(dict[phrase]);
     } else {
      out.push(phrase.charCodeAt(0));
     }
 
     dict[phrase + currChar] = code;
     code++;
     phrase = currChar;
    }
   }
 
   if (phrase.length > 1) {
    out.push(dict[phrase]);
   } else {
    out.push(phrase.charCodeAt(0));
   }
   ol = out.length;
   while (ol--) {
    out[ol] = fcc(out[ol]);
   }
 
   return out.join("");
  }
 
  // Decompress an LZW-encoded string
 
  function lzw_decode2(s) {
   var dict = {},
       data = s.split(""),
       currChar = data[0],
       oldPhrase = currChar,
       out = [currChar],
       code = 256,
       phrase, i = 1,
       l = data.length,
       currCode;
 
   for (; i < l; i++) {
    var currCode = data[i].charCodeAt(0);
    if (currCode < 256) {
     phrase = data[i];
    }
    else {
     if (dict[currCode]) {
      phrase = dict[currCode];
     } else {
      phrase = oldPhrase + currChar;
     }
    }
    out.push(phrase);
    currChar = phrase.charAt(0);
    dict[code] = oldPhrase + currChar;
    code++;
    oldPhrase = phrase;
   }
   return out.join("");
  }
 
 
  var ipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a eros non sem facilisis eleifend. Praesent sit amet nibh vel arcu volutpat pellentesque. Integer ut nisi sit amet lorem pellentesque congue. Mauris non purus risus, eu imperdiet justo. Nam eleifend gravida diam sed ullamcorper. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sit amet nulla in orci ultrices facilisis. Quisque eget diam libero. Ut aliquam tempor porttitor. Vivamus quis enim augue. Suspendisse quis nisl lorem, in sollicitudin arcu. Aliquam aliquet metus lacus. Nunc vitae nisi lectus, sed porttitor metus. Quisque lectus ipsum, hendrerit sit amet consectetur at, viverra id risus. Vivamus tempus lobortis lectus, in varius enim tristique sollicitudin. Donec pellentesque consectetur est vel lobortis. Nulla in sollicitudin libero. Suspendisse ac sem quis tortor ultricies mattis eu eget ipsum. In vehicula, enim sed gravida hendrerit, sapien est varius diam, et commodo mauris risus et arcu. Praesent sapien mauris, adipiscing ac commodo et, molestie non sapien. Mauris nulla elit, fringilla ac consectetur a, congue sit amet mi. Donec quis iaculis ipsum. Vivamus sit amet enim mauris. Cras venenatis justo a justo fermentum placerat. Fusce magna nibh, cursus vitae tristique at, condimentum nec lorem. Nullam justo purus, imperdiet sit amet interdum nec, aliquet dictum metus. Aenean consectetur dictum diam, et cursus sapien egestas eget. Aenean eu hendrerit lorem. Etiam cursus sem sit amet sapien placerat ullamcorper. Aliquam ante purus, sodales vitae porta non, tempor at turpis. Sed id turpis sem, vitae varius est. Sed velit felis, lacinia eget rutrum semper, accumsan ut magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In facilisis neque ac lorem placerat congue. Duis posuere, arcu nec condimentum venenatis, urna nulla viverra urna, nec lacinia purus nunc ut diam. Nam accumsan, eros sit amet placerat pharetra, ligula nisi dapibus leo, sit amet condimentum diam justo in enim. Nulla faucibus facilisis velit, et adipiscing magna rutrum sit amet. Curabitur vitae consequat risus. Praesent quis sapien id felis cursus cursus. Nulla vestibulum urna est, quis ornare leo. Aenean est tellus, volutpat a rutrum ut, facilisis quis elit. Integer convallis felis a dolor bibendum semper tincidunt ante aliquam. Phasellus vel ligula vel nulla facilisis dictum eget vel neque. Vestibulum suscipit lacus vestibulum enim eleifend elementum. Integer ut ligula ut eros aliquam vehicula vitae at erat. Sed ante nulla, tristique et interdum non, dapibus ac quam. Donec convallis dui ut ligula lobortis elementum. Vivamus non dui vitae ante rhoncus iaculis ut sit amet purus. Pellentesque pellentesque tempus turpis quis accumsan. Aliquam bibendum lorem eu nunc commodo dapibus sit amet in urna. Morbi ac odio blandit odio semper ullamcorper ac sed ante. Aliquam mollis molestie porta. Nam eleifend luctus consequat. Suspendisse potenti. Donec fermentum ullamcorper ultricies. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed sodales turpis justo. Phasellus aliquet vestibulum leo id consectetur. Fusce consectetur turpis quis sem adipiscing et accumsan leo imperdiet. Sed quis lectus mi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque sit amet nunc dui. Quisque cursus, risus at rutrum facilisis, dui leo rhoncus lectus, mattis adipiscing turpis quam et augue. Etiam sodales dolor sed nulla pulvinar tincidunt quis non erat. Mauris viverra nulla sed nisl dignissim nec vulputate mauris mollis. Curabitur ante felis, sagittis vel pharetra non, accumsan in enim. Sed urna orci, sodales in fringilla tincidunt, posuere tincidunt massa. Integer fermentum hendrerit dictum. Aliquam sed nisi augue. Praesent nibh neque, vulputate at aliquam at, convallis ut metus. Proin ipsum diam, faucibus vel posuere ac, scelerisque eu sem. Aenean nec magna urna. Sed consectetur pretium urna, vel tincidunt leo tincidunt at. Integer facilisis ante vitae sapien malesuada sit amet pellentesque magna tristique. Ut auctor pretium eros non fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Ut non sem lorem, nec fermentum nisi. Duis non lacus massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris sapien odio, interdum in vulputate porta, sollicitudin vitae lacus. Curabitur quis dui enim. Maecenas augue purus, malesuada nec ultrices id, cursus vel leo. Suspendisse ante quam, imperdiet et luctus euismod, blandit sed diam. Aenean lorem enim, sodales sed sodales quis, fermentum et dui. Quisque fringilla, dui ut hendrerit ullamcorper, nibh nulla tempus orci, sed mollis elit orci quis orci. Morbi tristique malesuada purus ut laoreet. Aenean vel luctus velit. Cras imperdiet nisi sed augue posuere tempus placerat velit mattis. Aliquam sollicitudin turpis quis ligula consectetur pretium. Sed et lacinia risus. Aenean sit amet nunc eros, quis dapibus sapien. Morbi in ligula vitae dolor fringilla pharetra sed vitae sem. Nulla mollis, nisi sit amet aliquam pulvinar, turpis eros vestibulum justo, et consectetur velit quam eget urna. Cras accumsan pulvinar dui placerat sodales. Sed tristique, sem sed cursus faucibus, risus arcu viverra nisl, ut scelerisque risus mi sed velit. Aenean a ligula augue. Sed aliquet arcu sed lectus laoreet congue. Donec scelerisque cursus nunc, eu fringilla nisl tristique ac. Pellentesque ullamcorper, justo non malesuada tincidunt, mi dui gravida tortor, et tristique eros nisl nec ipsum. Morbi erat arcu, accumsan sed vestibulum nec, vulputate vel nisl. Nullam pretium ligula lacinia nunc luctus non ullamcorper nisl rutrum. Cras ac congue mauris. Duis mollis arcu id lacus bibendum et suscipit ante malesuada. Phasellus non leo vulputate sem porta feugiat et sed neque. Integer metus libero, interdum vitae iaculis non, tincidunt ac lacus. Sed eu ante sapien, ut dignissim metus. Etiam aliquet, diam laoreet bibendum suscipit, orci enim dignissim neque, non ultricies eros tortor ac metus. Quisque placerat, risus sed eleifend interdum, purus ante commodo dolor, non scelerisque libero mauris at justo. Vestibulum iaculis pellentesque libero pharetra ullamcorper. Phasellus mi mauris, cursus id facilisis nec, dignissim in nibh. Nulla ut accumsan sem. Nullam porttitor volutpat tempor. Nullam hendrerit, ipsum eget gravida cursus, enim enim dapibus purus, vitae condimentum nisi est ut augue. Aliquam hendrerit sapien ac sem ultrices ac condimentum arcu porttitor. Duis gravida congue lorem. Sed blandit lobortis neque, vestibulum ultricies nulla sodales vitae. Donec eu mi ut massa faucibus consequat nec sit amet dui. Ut nec massa tortor. Quisque eget porta sapien. Duis nec justo a lacus posuere sagittis. Donec euismod scelerisque tortor pellentesque laoreet. Vivamus iaculis nisl vitae dolor posuere ac consectetur odio faucibus. Phasellus varius eros quis arcu adipiscing eget scelerisque sem suscipit. Phasellus vitae dictum dui. Phasellus eget dapibus sapien. Ut malesuada mi sed quam tincidunt hendrerit. Mauris at nisi vitae mi aliquam semper at nec diam. Quisque ut ligula sit amet nisi bibendum pellentesque. Nullam vitae massa et odio condimentum adipiscing nec nec dolor. Etiam consequat pellentesque facilisis. Nulla non egestas augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas tincidunt sem quis magna aliquet ac tincidunt ipsum mattis. Morbi at odio turpis, ac gravida augue. In tempor, est quis vehicula lobortis, nisi ligula rutrum orci, id ornare ante purus vel felis. Cras posuere lectus a eros rhoncus consequat. Praesent a eros ipsum, quis mollis felis. Donec iaculis euismod neque non consectetur. Praesent ultricies eros nec enim facilisis ac consectetur sapien sagittis. Nulla tincidunt varius dui ultricies consectetur. Vivamus nec massa quis ligula convallis suscipit. Aliquam ullamcorper euismod ligula, a sodales sapien iaculis et. Integer quam odio, ornare sit amet egestas et, fermentum sed enim. Phasellus elementum suscipit metus eu ultricies. Suspendisse enim libero, molestie ac sodales sed, pulvinar sit amet magna. Duis commodo laoreet laoreet. Vivamus in ligula nec lorem condimentum aliquet. Sed blandit augue a enim sodales eleifend. Morbi suscipit tellus a mi porta eu congue enim egestas. Sed at euismod ipsum. Praesent accumsan justo a metus viverra vulputate. Phasellus non augue sit amet dui mattis convallis. Donec pulvinar orci nec felis tincidunt vel dictum sem lacinia. Sed malesuada velit at sem aliquam nec commodo eros tincidunt. Pellentesque sodales tellus a nisl imperdiet tempus. In hac habitasse platea dictumst. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas sit amet mi quis neque lobortis hendrerit. Pellentesque quis magna nibh. Nullam et molestie purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In at ipsum dolor. Nullam sed nulla ut quam adipiscing suscipit. Nam urna libero, bibendum nec porta sit amet, consectetur at neque. Phasellus viverra, sem non bibendum lobortis, nibh elit commodo arcu, at hendrerit mauris urna eget nisi. Duis erat mi, varius eu lobortis eu, varius at est. Mauris quis lobortis quam. Fusce sagittis erat sed magna iaculis a congue ante tincidunt. Quisque mi metus, vestibulum eget porta a, posuere vel augue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Morbi quis felis accumsan elit gravida eleifend malesuada eu odio. Praesent elementum egestas nisi, vitae posuere tellus pellentesque in. Phasellus et enim vitae magna facilisis varius. Morbi placerat elementum eros, id bibendum leo aliquam ut. Aliquam consequat libero nec odio consectetur volutpat.";
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
With LZW Compression
lzw_decode(lzw_encode(ipsum));
pending…
With Tuned LZW Compression
lzw_decode2(lzw_encode2(ipsum));
pending…
With LZJB Compression
Iuppiter.decompress(Iuppiter.compress(ipsum));
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. Here’s a list of current revisions for this page:

0 comments

Add a comment