←back to thread

32 points matt_d | 5 comments | | HN request time: 0.001s | source
1. orlp ◴[] No.45138254[source]
Every developer I've talked to has had the same experience with compilation caches as me: they're great. Until one day you waste a couple hours of your time chasing a bug caused by a stale cache. From that point on your trust is shattered, and there's always a little voice in the back of your head when debugging something which says "could this be caused by a stale cache?". And you turn it off again for peace of mind.
replies(3): >>45159702 #>>45159758 #>>45160578 #
2. johnisgood ◴[] No.45159702[source]
What kind of compilation caches, something like ccache[1]? Do you use it, or would you? It is for C and C++. Check out the features, they are pretty neat, IMO!

The documentation may come in handy:

1. https://ccache.dev/manual/4.11.3.html#_how_ccache_works

2. https://ccache.dev/manual/4.11.3.html#_cache_statistics

and so forth.

[1] https://ccache.dev (ccache - a fast C/C++ compiler cache)

3. Y_Y ◴[] No.45159758[source]
There are three hard problems in computer science, cache invalidation and naming things.
replies(1): >>45160231 #
4. aengelke ◴[] No.45160231[source]
Or rather: There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.

(source: https://martinfowler.com/bliki/TwoHardThings.html)

5. ACCount37 ◴[] No.45160578[source]
Don't you just do "flush the cache, rebuild" at the first suspicion? If the bug abruptly goes away, it was stale cache. It usually doesn't.