Giter VIP home page Giter VIP logo

Comments (2)

sasa1977 avatar sasa1977 commented on July 17, 2024

Hi,

Just invoking :ets.file2tab is not sufficient. As you mention in the code comment, this creates a new ETS table, but that's not the table managed by ConCache, so your data is not yet in the cache.

After you load this table, you need to iterate the table and store each element into ConCache using ConCache.put. Once you're done with that, you should drop the table created via :ets.file2tab.

One downside here is that during priming you have two copies of the data. The one is in the temp table, another in the cache. The first copy is dropped once you prime your ConCache table, but during priming you'll use more memory than you need. Depending on the amount of the cached data, this might or might not be a problem. If it is, consider using some "iterable" persistence format, which allows you to load each entry one by one, instead of loading everything at once.

Let me know if you have further questions.

from con_cache.

MikaAK avatar MikaAK commented on July 17, 2024

That does seem like a few extra hoops to jump through. Since the dataset being cached can get quite large it doesn't feel like this is a great option as there's a cost. PersistentETS may be better for what we need but it's good to know how to get persistent caching working.

from con_cache.

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.