[top-posting because I'm not sure if Bertram is on this list and therefore if he received Petr's reply]
Hi Bertram, I'll apply this, but could you run the standard darcs benchmarks (maybe improving them as needed) and send us some results? http://wiki.darcs.net/index.html/StandardDarcsBenchmarks Thanks! On Tue, Mar 10, 2009 at 19:44:11 +0100, Petr Rockai wrote: > Hi, > > > Improve memory usage of darcs check and repair. > > ----------------------------------------------- > >> Bertram Felgenhauer <[email protected]>**20090310120357 > >> 'applyAndFix' in D.Repository.Repair kept all processed patches around, > >> but only their info is actually needed. > >> ] hunk ./src/Darcs/Repository/Repair.hs 83 > >> aaf s NilFL = return ([], s, True) > >> aaf s (p:>:ps) = do > >> (s', mp') <- run_slurpy s $ applyAndTryToFix p > >> - finishedOneIO k $ show $ human_friendly $ info p > >> + let !infp = info p -- assure that 'p' can be garbage > >> collected. > >> + finishedOneIO k $ show $ human_friendly $ infp > Interesting. This indeed seems to make sense, however I have profiled the > current code before and haven't seen any leaks (ie. the profile looked pretty > flat). However, it might be that the reference to 'info p' post-recursion > crept > in only later than I have done my profiling, which would explain it. Either > that or something else. > > Also, a summary of how it affects actual memory usage would be great. I could > look into that, although my time is currently rather limited. Either way, I'll > do a benchmark run in a near future, comparing 2.2 against current trunk, so > at > that point, how much this patch helps (it should help a lot if the problem it > fixes is really happening, which is hard to discern for me right now). > > >> s'' <- syncSlurpy (update_slurpy r c opts) s' > >> (ps', s''', restok) <- aaf s'' ps > >> case mp' of > >> hunk ./src/Darcs/Repository/Repair.hs 91 > >> Nothing -> return (ps', s''', restok) > >> Just (e,pp) -> do putStrLn e > >> p' <- makePatchLazy r pp > >> - return ((info p, p'):ps', s''', False) > >> + return ((infp, p'):ps', s''', False) > I suppose this is the crucial bit, since if 'info p' wouldn't have been used > after the recursive call, p would be dead and therefore collectible. > > As far as correctness of the post-patch code is concerned, I believe the patch > doesn't change semantics at all, so it should be perfectly safe. > > Yours, > Petr. > > -- > Peter Rockai | me()mornfall!net | prockai()redhat!com > http://blog.mornfall.net | http://web.mornfall.net -- Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow> PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
