News for hackers. Stuff that matters.

Show HN: Ziperu is rubyzip with a Rust core, same API but faster and safer

https://github.com/caplanmaor/ziperu

Annoyed by slow zip handling in Ruby apps in gems like roo and caxlsx, they use rubyzip underneath which is pure Ruby and does a lot of per entry work in Ruby objects which is slow.

My project keeps the rubyzip API (Zip::File, Zip::InputStream, etc.) but does the parsing compression and file IO in Rust, using the zip crate via magnus/rb-sys. Change a line in your gemfile and I ship precompiled gems so no Rust toolchain to install.

About 6x faster reading lots of small entries, and 2x faster deflating big ones. It also adds a few things rubyzip doesn’t have like limits for zip bombs, an open mode that doesn’t modify the archive, and multithreaded compression.

To check I didn’t break anything, I run rubyzip’s own test suite against it (416 of 476 pass; most of the rest test rubyzip internals), fuzz it against Python’s zipfile, and run the test suites of roo, caxlsx, rubyXL and a few others with ziperu swapped in, working pretty well so far.

I would love to hear ideas for new features, or zip edge cases that annoy you!

( no comments | on HN )

There are no comments yet.