[PATCH 2 of 2] [WIP] parsers: use base-16 trie for faster node->rev mapping

Greg Ward greg at gerg.ca
Mon Mar 26 19:58:36 CDT 2012


On 22 March 2012, Bryan O'Sullivan said:
> This vastly speeds up node->rev lookups: "hg --time log" of rev
> 1000 on a linux-2.6 repo improves from 0.27 seconds to 0.08.

Strange. I've applied both of your patches and done extensive
performance testing with a large repo (128k revisions) on my old, slow
laptop ... and I'm seeing no change at all. Nothing. Not a sausage.
Bugger all.

I tried "hg tip", "hg log -v -r REV", "hg log -v -r SHORTNODE", and
"hg log -v -r FULLNODE" ... and for every single test, runtime and
memory usage is the same with and without your patch.

To make sure I'm really running with your patch, I sabotaged the code
by adding abort() calls in parsers.c, and hg does indeed dump core.

This is probably some dumb mistake on my part, but can you think of
anything in your patch that would render it useless on 9-year-old
hardware? I mean, it's not from the Dark Ages or anything: 32-bit
Pentium M, 1.5 GB of RAM, slow IDE disk. It seems bizarre to me that
your straightforward-looking C code would be so effective in your test
but not in mine. 

I'll try again in the morning... I'm probably missing something big
and obvious.

        Greg
-- 
Greg Ward                                http://www.gerg.ca/
This quote intentionally left blank.


More information about the Mercurial-devel mailing list