\

Show HN: Cachekit – High performance caching policies library in Rust

43 points - today at 2:28 AM

Source
  • virtualritz

    today at 7:36 AM

    Should be checked against official Rust API naming guidelines. LrukCache, not LRUKCache etc.

    https://rust-lang.github.io/api-guidelines/naming.html#casin...

      • yccs27

        today at 8:50 AM

        Thanks for the link, nice to see the informal conventions spelled out like this!

        • failsafe

          today at 8:12 AM

          ah, gad damn it. cheers though :P

      • fyrn_

        today at 8:05 AM

        Would love to see benchmarks vs competition considering the high performance claim. Foyer is another rust hybrid cache, and quick-cache is the fastest in-memory impl I'm aware of.

        Sane defaults and easy of setting a memory limit are two other things I look for in caches.

        • carlmr

          today at 7:07 AM

          On your example, without reading into the implementation, I'm wondering if the comment is wrong, or if the comment is telling us about a hidden default, but then what does the 2 mean.

              // Create an LRU cache with a capacity of 100 entries
              let mut cache = LRUKCache::new(2);
          
          
          Why 100? Why not 2?

            • touisteur

              today at 12:03 PM

              Another time I wish rust had named parameters. For reading code without an IDE (which is a lot of the experience in discovering a library, learning, navigating in code on github...) it would be useful.

              • failsafe

                today at 7:26 AM

                derp, It should be LRU instead of LRU-K.

            • today at 2:25 PM