[PATCH] more speedups

Chris Mason mason at suse.com
Tue Jun 28 19:53:38 CDT 2005


Here are a few more speedups that should help in more than just patch import 
case. 

Time to import 2724 patches:

git:                                         11m45s (4m32s user, 6m7 sys)
stock hg:                                 11m15s (8m36s user, 1m38s sys)
manifest.add with bisect only: 7m11s (4m41s user, 1m36s sys)
manifest.add with deltas:        6m13s (3m39s user, 1m37s sys)
deltas + one trans patch:       5m30s (3m37s user, 1m11s sys)
w/ sha1 patch:                        5m9s (3m14s user, 59s sys)
w/ copy patches:                    3m52s (2m7s user, 51s sys)

First, the sha1 hash() function was duplicating the text of the object being 
hashed.  A simple rework improves things.

Second, the manifest map is a big expensive object.  Each time it gets copied 
adds around 20 seconds to the run.  manifest.read() makes a copy of the 
object before returning it, but this is inconsistent with how it gets used in 
a few places (where it is immediately copied again), and with how the rest of 
the manifest funcs work.

The last patch is incremental to the manifest.add patch posted in a different 
thread.  Since I'm generating the deltas on the fly, I don't need to make a 
copy of the add list for delta generation.  The down side is that I can't 
verify the delta as correct as easily.

I think this is as good as I can reasonably do right now, I might try to tweak 
a few other areas while I try to convince Matt some of these changes are 
worthwhile.

-chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sha1
Type: text/x-diff
Size: 519 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050628/7349c6a2/sha1.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: manifest.read
Type: text/x-diff
Size: 568 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050628/7349c6a2/manifest.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: manifest.addlist
Type: text/x-diff
Size: 1049 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050628/7349c6a2/manifest-0001.bin


More information about the Mercurial mailing list