heikkilevanto / beertracker

Simple script to track the beers I drink
GNU General Public License v2.0
2 stars 1 forks source link

File index #343

Closed heikkilevanto closed 4 days ago

heikkilevanto commented 4 days ago

If the file reading persists to be a problem after #340, we could add an index file, pointing to the file offset where each year starts. Or actually a little before, so we can read a (partial) line, and be near the right position. That way, we could seek into the beginning of the relevant year, and read only from there on.

The index could be regenerated when ever we need to read the whole file, like for statistics, and saved on disk if different from the old index.

Probably won't be necessary, but wanted to write the idea down.