Open loynoir opened 6 months ago
Not sure it is a bug here. The cache is preserved, the stats aren't
Yes, cache are preserved.
But when I happened to curious about the cache hit rate all these times, disappointedly, I found the cache hit rate stats are lost.
I think, it is a design bug, that I cannot see the history cache hit rate stats, since when I started to use sccache to now.
Hope a default option, or at least an opt-in config option, to persist cache hit rate stats.
adv-stats-persist-path =
ccache
does not have problem to see history cache hit rate stats, because ccache
does not use client-server model
.
Quote README.md
sccache works using a client-server model, where the server runs locally on the same machine as the client. The client-server model allows the server to be more efficient by keeping some state in memory.
So, there are two possibilities.
If client-server model
is not very important
Would be nice to introduce opt-in config option no-client-server-model: bool
, to use sccache without client-server model.
After that, sccache
is able to see history cache hit stats.
If client-server model
is very important
I guess, there are important state cache other than fileish cache?
If cache hit stats are lost, non-fileish important cache are lost too.
Would be nice to introduce default config option server-non-fileish-cache-value-dump-path: string
, to resume server to its best when devcontainer restart.
After that, resumed from restart sccache
server should have a lot more better performance.
Note that you can store the stats into a json file easily with --show-adv-stats --stats-format=json
As we don't have the use for persistent cache results (and I would not use it in general. I prefer to have stats per run of a project to easily see its impact or issues), I don't think we are going to spend time on it. So, PR welcome.
The client-server model has nothing to do with not keeping stats. The main blocker is that the main sccache use-case is to use a shared non-local cache. Persisting its stats is a challenge in itself.
BUG
sccache
does not persist cache hit stats when server stopactual
When devcontainer restart, sccache restart.
sccache
does not persist cache hit stats when server restart.It leads to cache hit stats lost, all zero.
expected
sccache
persist cache hit stats when server restart.Keep cache stats across sccache restart.