Chame.d with no mem alloc

The Anh Tran trtheanh at gmail.com
Mon Jul 21 15:30:43 PDT 2008


bearophile wrote:
> The Anh Tran:
>> But sometime the same code gives big surprise. Ie: threadring game.
> 
> This surprises can be useful to you to learn and to the designers of D to debug it (I'm assuming such libraries have to work on both operating systems).
> 
> 
>>> Can't you avoid the same allocation with D?
>> Yes :). The D ver was targeting code beauty, not speed. :|
> 
> The Shootout site allows more than on version for each benchmark, if their purpose is different. For example here you can see two D versions:
> http://shootout.alioth.debian.org/gp4/benchmark.php?test=binarytrees&lang=all
> One is mine, its purpose is to have a short and high level code, the other is for speed. The main purpose of the site is to compare speed, but it compares memory used and code complexity too.
> 
> 
>> I have no idea. They only differ by 2 mem alloc calls.
> 
> Maybe the thread module of Phobos has some problems. But I suggest you to write a version without the memory allocations, to see how it performs. The garbage collector of D may be the fault too here.
> 
> Bye and thank you,
> bearophile

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: chame3.d
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20080722/5eb0bab4/attachment.asc>


More information about the Digitalmars-d-learn mailing list