[PATCH] Fix for irritating depends bug
auke at foo-projects.org
Sun Mar 4 22:05:47 CET 2012
On 03/04/2012 11:11 AM, Zbigniew Luszpinski wrote:
>> the idea of on-the-fly "adjusting" the cache seems wrong, why not just
>> throw it away and have it regenerated? that's a much cleaner solution
> Why do you find it wrong? From performance point of view selectively
> cutting whats wrong is faster then regenerating whole cache.
it's not wrong per se but the chance for consumers to have mid-air
collisions becomes larger if we edit these files like this. It may look
like a quick operation, but it's not, and a failure could lead to the
dependency resolver going flat on its face - and there is a lot of
dependency resolving going on when you hit that code.
so, a cleaner way would just be to evict the cache and have it
auto-generated. that's always going to work, and the amount of times
that you'd do that are so minimal that there's no reason to optimize
this and introduce risk.
if you really want to do this, at a minimum you must introduce strong
locking at every place where the cache is referenced, and that will kill
your performance more than you get back from in-situ changing it.
So, it's not wrong per se on itself, but it's not complete and has big
drawbacks that are not worth spending time on.
More information about the Lunar-dev