[PATCH 1 of 2] repoview: invalidate visible cached revs when dynamic blockers change
pierre-yves.david at ens-lyon.org
Tue Jun 16 13:02:13 CDT 2015
On 06/16/2015 10:03 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1434407619 25200
> # Mon Jun 15 15:33:39 2015 -0700
> # Node ID ec65a79467e52a695700f7abfa9e4c55f3cc6c91
> # Parent a69983942fb4dbfdf5ca8c7a123120ed09ead5db
> repoview: invalidate visible cached revs when dynamic blockers change
> Before this patch, we were invalidating the filteredrevs cache when the
> dynamic blockers changed at each dynamic blocker change.
> This patch moves the cache invalidation logic to a central place, when the list
> of filteredrevs is queried.
> It enhances the performance and legibility of the code:
> - Performance, because we invalidate the cache only when we need the
> result of the computation and only once for multiple changes affecting the
> dynamic blockers.
> - Legibility of the code as we now have a single place to invalidate the cache
> removing the need to invalidate the cache for every operation that could
> make dirty.
Having a more targeted invalidation is a good idea (for perf and
legibility). However, there is more to do than that. Other filter need
to be invalidated in other condition, and the invalidation of one filter
have consequence on other filter (And maybe some obs-related set). eg:
changing visible, change served.
I'm not supe happy about having a cache specifically for visible. But I
would be okay with taking the patch if dependency issue pointed above
where not there.
More information about the Mercurial-devel