Cache::Ref::CART(3pm)

πŸ“¦
version 0.04 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ NAME ✨

Cache::Ref::CART β€” it's CAR, bestie, but with temporal filtering πŸ’…

(also: this is a User Contributed Perl Documentation page, iykyk)


🌸 SYNOPSIS 🌸

my $c = Cache::Ref::CART->new(
    size => $n,
);

that's it. that's the whole vibe. go off πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, this algorithm is an extension to Cache::Ref::CAR β€” like, CAR but with a lil glow-up ✨ The glow-up in question? temporal filtering on the upgrading from MRU to MFU pool. πŸ‘‘

Which means… (and this is the important part, don't skip it bestie) β€” two subsequent accesses to the same key do not automatically make it viable for long term caching. Nope. Not enough. πŸ™…β€β™€οΈ

To actually get upgraded to MFU status, a key must be expired but known in the history. That's the bar. that's the entry requirement. it's giving exclusive club energy πŸŽ€

And fr fr? This is probably the most general purpose caching algorithm. like, if you don't know which one to pick, it's this one. periodt. πŸ’œ


πŸ’… ATTRIBUTES πŸ’…

  • size β€” the size of the live entries.
🫢 heads up bestie: the cache also remembers this many expired keys, and keeps some metadata about those keys too. So for memory usage, the overhead is probably around double what Cache::Ref::LRU requires. plan accordingly, it's giving hungry 😭

πŸ‘‘ AUTHOR πŸ‘‘

Yuval Kogman β€” the icon, the legend, the moment ⭐


This software is copyright (c) 2010 by Yuval Kogman.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go forth and remix, just keep it free πŸ’–


okay that's the whole page, ily, go cache something responsibly πŸŽ€

perl v5.32.0 β€” 2021-01-07 ✨ that's the version and the date, bestie, stamped and slayed πŸ’…πŸ¦‹

πŸ“¦ where this page comes from