Coder Social home page Coder Social logo

Comments (2)

WhyNotHugo avatar WhyNotHugo commented on July 21, 2024

I'm thinking of an implementation using gob to serialise the in-memory representation of the todos, along with their id, and save that to a file.

When tdx runs the next time, it'll de-serialise all of them, and only read (1) files that have a modification date later than the dump (2) new files.

This should provide some minor performance improvements while not really increasing complexity, and keep consistent ids.

I can try giving this a shot if this sounds good.

from tdx.

kkga avatar kkga commented on July 21, 2024

This sounds great.

I started initial work on persistent IDs using a bolt database a while ago, but I only spent a few hours on it to get familiar with how bolt works: 8a8124c

My idea was to store the representation of vidir in a key-value store with id-filepath entries and then on each consecutive read, tdx will: (1) get the list of entries from the database, (2) walk the vidir path and remove/add any missing and new entries, (3) write the updates to database. This way the IDs will be stored in the database and should not change unless the user decides to rebuild the database by issuing some command. This is probably what todoman does?

I'm not sure of the benefits/downsides between using gob or a database, so feel free to use any approach you're comfortable benefits.

from tdx.

Related Issues (4)

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.