[PATCH 3 of 3] revlog: remove cache validation

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Nov 22 22:40:34 CST 2015



On 11/22/2015 07:34 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1448243855 28800
> #      Sun Nov 22 17:57:35 2015 -0800
> # Node ID 3818d1ea14c24c73f23925dcee21d0f71fb7a8b5
> # Parent  9b10f53e1f1a8ab3850577610498dff590ee8357
> revlog: remove cache validation
>
> Previously, we likely called _chunkraw() multiple times in order to
> ensure it didn't change out from under us. I'm pretty certain this code
> had its origins in the days where we attempted to have thread safety of
> localrepository and thus revlog instances.
>
> revlog instances are already not thread safe for writing. And, as of
> Mercurial 3.6, hgweb uses a separate localrepository instance per
> request, so there is no thread contention. We more or less decided
> that attempting to make classes like revlog thread safe is a lost
> cause.
>
> So, this patch removes thread safety from _chunks. As a result, we make
> one less call into _chunkraw() when the initial read isn't serviced
> by the cache. This translates to savings of 4 function calls overall
> and possibly prevents the creation of an additional buffer view into the
> cache. I doubt this translates into any real world performance wins
> because decompression will almost certainly dwarf time spent in
> _chunks().


The series looks good, but why are we doing all this if this the win is 
unlikely to be relevant?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list