Giter Site home page Giter Site logo

Comments (5)

sathyaphoenix avatar sathyaphoenix commented on April 19, 2024

@wenhaocs good catch. Do you mind sending a PR to address that and I can merge it.

from cachelib.

wenhaocs avatar wenhaocs commented on April 19, 2024

@sathyaphoenix Please let me know if you want to throw error explicitly and tell users the limit for #cacheEntries, or just implicitly set the bucketPower to be maximum like in the PR.

from cachelib.

jiayuebao avatar jiayuebao commented on April 19, 2024

@wenhaocs Shall we use std::min instead of std::max to pick the smaller value?

from cachelib.

sathyaphoenix avatar sathyaphoenix commented on April 19, 2024

To be consistent with the constructor, it makes sense to throw an error when the value is going to be incorrect rather than silently fix it. Most likely in this case the user gave a wrong input and it is better to abort rather than silently run with a misconfigured hash table. Also, like @jiayuebao pointed out, we should be doing a std::min instead of max if we were to adjust to a meaningful value.

@wenhaocs can you add a simple unit test for this ? we can introduce a new .cpp here to add CacheAllocatorConfig unit tests. @jiayuebao please let us know if there is a better place to add the test.

from cachelib.

jiayuebao avatar jiayuebao commented on April 19, 2024

For unit test, we already have one here. And we can add more cases there.

from cachelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.