Follow

I'd like to announce the first release of cacache for Rust! crates.io/crates/cacache

cacache is an implementation of a content-addressable disk cache. It's fast, secure, concurrency-safe, and is also the cache for npm! The Rust version is fully compatible with the original!

For context, cacache was the first bit of rewriting in what would become npm@5 several years ago, and is still one of the libraries I'm most proud of writing in my time at npm. Rewriting it in Rust as an adventure and so-much-fun! I look forward to publishing a lot more crates ☺️

So I finally got around to benchmarking cacache, and the results are in! The Rust version is literally *an order of magnitude* faster, for the same work.

18 *microseconds* per read, on the Rust side. That's also as fast as the *memoized* version on the Node side.

@zkat I wanna see if I can use this in #activitydesk so I can speed up that initial loading of posts being shown

@zkat this is lovely code! Super legible all around.

And it made me learn about atomicwrites - this will come in handy.

@federicomena gracias! Me siento muy agradecida que hayas tomado algo de tu tiempo para revisar mi código! Espero que atomicwrites te ayude 😁

@zkat hace tiempo que no veía código hecho casi sólo con funciones, sin un montón de objetos, y así de legible. Se entienden de inmediato la estructura y qué quieren decir los Integrity.

Sign in to participate in the conversation
Toot.Cat

A Mastodon instance for cats, the people who love them, and kindness in general. We strive to be a radically inclusive safe space. By creating an account, you agree to follow our CoC below.

Instance Administration

  • Woozle: Supreme Uberwensch, general support, web hostess
  • Charlotte: tech support, apprentice in warp-drive arcana (aka Mastomaintenance)
  • ash: backend stuff, gay crimes

The Project: