Mercurial > hg
view tests/test-revlog-packentry.t @ 34880:9e18ab7f7240
sparse-read: move from a recursive-based approach to a heap-based one
The previous recursive approach was trying to optimise each read slice to have
a good density. It had the tendency to over-optimize smaller slices while
leaving larger hole in others.
The new approach focuses on improving the combined density of all the reads,
instead of the individual slices. It slices at the largest gaps first, as they
reduce the total amount of read data the most efficiently.
Another benefit of this approach is that we iterate over the delta chain only
once, reducing the overhead of slicing long delta chains.
On the repository we use for tests, the new approach shows similar or faster
performance than the current default linear full read.
The repository contains about 450,000 revisions with many concurrent
topological branches. Tests have been run on two versions of the repository:
one built with the current delta constraint, and the other with an unlimited
delta span (using 'experimental.maxdeltachainspan=0')
Below are timings for building 1% of all the revision in the manifest log using
'hg perfrevlogrevisions -m'. Times are given in seconds. They include the new
couple of follow-up changeset in this series.
delta-span standard unlimited
linear-read 922s 632s
sparse-read 814s 566s
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 18 Oct 2017 12:53:00 +0200 |
parents | 6cc1f388ac80 |
children | 009d0283de5f |
line wrap: on
line source
$ hg init repo $ cd repo $ touch foo $ hg ci -Am 'add foo' adding foo $ hg up -C null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved this should be stored as a delta against rev 0 $ echo foo bar baz > foo $ hg ci -Am 'add foo again' adding foo created new head $ hg debugindex foo rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 0 ..... 0 b80de5d13875 000000000000 000000000000 (re) 1 0 13 ..... 1 0376abec49b8 000000000000 000000000000 (re) $ cd ..