D memory consumption/runtime speed problem

BCS none at anon.com
Wed Jan 13 18:20:56 PST 2010


Hello sybrandy,

> Hello,
> 
> I've been writing a bit of compression code and I noticed some strange
> behavior that's driving me a bit batty.  I don't know if it's a bug
> with D or something I did.  All I know is I can't figure it out.
> 
> Below is the simplified version of the code as a single file.  It
> takes two parameters.  The first is a file to "compress" and the
> second is the number of times to run the benchmark.  E.g. bugtest
> foo.txt 2
> 
> Now, if I set the second parameter to 1, it runs decently fast.  26
> seconds on my work laptop for a half-sized enwiki8 from the Hutter
> challenge.  If I set it to 2, then it takes about 142 seconds.  In
> both cases a lot of memory is used and I'm not really sure why.  Also,
> after it prints out the results, it takes several seconds for the
> program to exit.
> 
> Am I doing something wrong?  I've tried every trick that I could find
> by reading the documentation.  Btw: The last time I tried this was
> with the latest version of D released at the beginning of the month.
> 

My guess is that you are getting long GC pauses. D's GC is rather unadvanced. 
IIRC there are ways to can make it do better but I don't know what they are.




More information about the Digitalmars-d-learn mailing list