##// END OF EJS Templates
revlog: remove unnecessary cache validation in _chunks...
revlog: remove unnecessary cache validation in _chunks 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 should only be a single thread reading a revlog at a time. 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(). But it does make the code simpler, so it is an improvement.
Gregory Szorc -
r27650:e7222d32 default
Show More
Name Size Modified Last Commit Author
contrib
doc
hgext
i18n
mercurial
tests
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install:

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

Running without installing:

$ make local # build for inplace usage
$ ./hg --version # should show the latest version

See https://mercurial-scm.org/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.