News for hackers. Stuff that matters.
Re:Zip.js - A JavaScript library to zip and unzip files by udp on Wednesday February 01, 2012 @07:22AM (#3537620)
Pretty cool, but the thought of inflate/deflate running in Javascript makes me cringe. How fast is this?
Re:Zip.js - A JavaScript library to zip and unzip files by bradleyland on Wednesday February 01, 2012 @09:38AM (#3538080)
I just tested with a 42 MB text log file under OS X 10.7.2.

Using zip 3.0:

    $ time zip logfile.zip logfile.log

    adding: logfile.log (deflated 89%)

    real	0m1.170s
    user	0m0.947s
    sys	0m0.030s
Resulting file size: 4,551,020 bytes

Using Chrome 16.0.912.77:

    4.7s - 1st drop
    5.5s - 2nd drop
    5.2s - 3rd drop
    5.1s - 4th drop
    Average 5.125s
    (timed using stopwatch)
Resulting file size: 4,547,885 bytes

Size: Advantage Zip.js by 3,135 bytes (roughly 3k; 6.8% better than zip) Speed: Advantage zip by 3.955s (77% better than Zip.js)

Re:Zip.js - A JavaScript library to zip and unzip files by halter73 on Wednesday February 01, 2012 @10:30AM (#3538312)
Zip.js only has a .069% size advantage over zip 3.0 given your numbers (4,551,020 bytes & 4,547,885 bytes respectively).

Your calculation of 6.8% better than zip just seemed too impressive.

Re:Zip.js - A JavaScript library to zip and unzip files by bradleyland on Wednesday February 01, 2012 @12:01PM (#3538805)
Sorry, was off by a factor of 100.

Showing the math:

    zip        = 4,551,020
    zipjs      = 4,547,885
    diff       = zip - zipjs    => 3,135 bytes
    pctng_diff = diff/zip × 100 => 0.0688856564%
Re:Zip.js - A JavaScript library to zip and unzip files by cleverjake on Wednesday February 01, 2012 @08:39AM (#3537848)
While I haven't used this in production, I can say that for zipping up stuff that was already generated client side it is usually quicker than sending the data to the server to be zipped, then getting it back. While this seems like a just-because-its-cool sort of hack, it actually has awesome implications. Zipped file creation from offline apps? Yes please.
Re:Zip.js - A JavaScript library to zip and unzip files by fl3x on Wednesday February 01, 2012 @07:42AM (#3537676)
Edit: The numbers are only for the C implementation so they don't add much to the discussion. Sorry for posting too quickly!

I don't know about this library in particular, but there's some numbers available on http://liblzg.bitsnbites.eu/ for a similar library.

(The same author has also made a library for self extracting javascript code: http://crunchme.bitsnbites.eu/. Pretty cool, but probably not that useful outside of the demo scene.)