treefmt icon indicating copy to clipboard operation
treefmt copied to clipboard

Should we expire paths?

Open brianmcgee opened this issue 1 year ago • 2 comments

Currently, if the formatter config never changes and the cache is not manually cleared, over time, we will start to accrue paths in the cache, which may have been removed from the underlying filesystem.

Should we implement some form of path expiry?

brianmcgee avatar Oct 17 '24 08:10 brianmcgee

IIUC, I believe this could get worse if we implement https://github.com/numtide/treefmt/issues/455.

Not saying that it's bad right now, or that "worse" is bad either. For all I know, this file is, and always will be pretty small. I'll be keep an eye in it on my machine.

jfly avatar Oct 17 '24 13:10 jfly

IIUC, I believe this could get worse if we implement #455.

I would think that mixing in the configuration in addition to the formatters executable mod time and size, this would increase the frequency with which the cache is busted.

Not saying that it's bad right now, or that "worse" is bad either. For all I know, this file is, and always will be pretty small. I'll be keep an eye in it on my machine.

I did a quick check to see what size the cache is for a fresh run on nixpkgs:

✦ ❯ du -sh ~/.cache/treefmt/eval-cache/59e2792a29a62e45fe4128041f748a75e4a87e28.db 
7.1M	/home/brian/.cache/treefmt/eval-cache/59e2792a29a62e45fe4128041f748a75e4a8

brianmcgee avatar Oct 17 '24 14:10 brianmcgee