[darcs-users] darcs patch: Improve memory usage of darcs check and ... (and 1 more)

Bertram Felgenhauer int-e at gmx.de
Tue Mar 10 20:15:17 UTC 2009


Petr Rockai wrote:
> Hi,
> 
> > Improve memory usage of darcs check and repair.
> > -----------------------------------------------
> >> Bertram Felgenhauer <int-e at gmx.de>**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've run some tests on darcs' own repo, using
  darcs +RTS -sstderr -RTS check --no-test

version  | heap     | memory    | runtime
---------+----------+-----------+------------------------------------
2.1.0    |  5550776 |  31354880 | 17.83user 8.10system 0:26.45elapsed
2.2.0    | 63358776 | 166244352 | 27.13user 1.39system 0:29.13elapsed
2.2.0+152| 63388496 | 166510592 | 27.09user 1.26system 0:28.90elapsed
+patch   |  7129280 |  56877056 | 23.73user 1.09system 0:25.28elapsed

version: darcs version (all compiled with ghc -O2)
heap:    maximum heap residency according to the RTS
memory:  maximum resident memory size according to the number of
         minor page faults reported by /usr/bin/time, with
         plausibility checked using top.
runtime: runtime as reported by /usr/bin/time

System:    Linux 2.6.27.10. /tmp FS is ext2 (relevant for 2.1.0 timings)
Prozessor: AthlonXP 1.8 Ghz. (32 bit)

Eric Kow:
> 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

I'll try that out.

Bertram


More information about the darcs-users mailing list