Hello,
I sent a patch just like this to Petr back on Mon, Sep 28, 2009, but
it was not applied. I don't know why. Petr, was there some problem
with the changes below? Note: I did have to recreate the patch
because it was not applicable against HEAD due to an unrename of the
darcs.cabal file (some odd patch dependency issue).
Here is the description of why I created this patch:
[this] patch is a refactor that gives a pretty substantial
performance boost. I haven't necessarily implemented it in the best
mananer, just the simplest.
We were effectively constructing the sequence of pending patches
twice, or at least some of them.
With profiling enabled:
Before this change:
322 MB total memory in use (2 MB lost due to
fragmentation)
Total time 61.23s ( 65.00s elapsed)
After this change:
245 MB total memory in use (2 MB lost due to
fragmentation)
Total time 48.28s ( 59.95s elapsed)
Normal builds:
Before this change:
223 MB total memory in use (2 MB lost due to
fragmentation)
Total time 14.50s ( 16.17s elapsed)
%GC time 25.0% (24.8% elapsed)
Productivity 75.0% of total user, 67.3% of total elapsed
After this change:
174 MB total memory in use (1 MB lost due to
fragmentation)
Total time 12.52s ( 14.01s elapsed)
%GC time 22.8% (22.4% elapsed)
Productivity 77.2% of total user, 69.0% of total elapsed
So, it seems to save about 2 seconds of runtime, and close to 50
megs of physical ram.
Please let me know if you have questions! It's much much better
performance now on this particular use case than the darcs.net source,
which uses over 400 megs of ram and takes closer to a minute.
Thanks,
Jason
Sun Nov 15 16:53:12 PST 2009 Jason Dagit <dagit@codersbase.com>
* Avoid a redundant read of pending in State.hs
Attachments
|