Phobos threads performance

The Anh Tran trtheanh at gmail.com
Mon Jul 21 14:05:08 PDT 2008


I come from Visual C++ world. And just learn D in about 10 days. So i 
screwed up many times in D code :/
Perhap i'll posted here for peers commence first.

bearophile wrote:
> The Anh Tran:
>> Don't use win to write Alioth game. :(
> 
> I don't fully agree. I think a portable enough language has to allow you to compile the program on different operating systems and give you the same results. D wants to be a quite portable language. So this is one more test for the language itself.
> Java generally allows me to do that, as Python.
> But as you may have seen this time I have found the Psyco version may give different results (but maybe the error is mine somewhere), so I may give up on that.
> Your D version works correctly on Win too.

I completely agree with you. But sometime the same code gives big 
surprise. Ie: threadring game.


> Can't you avoid the same allocation with D?
Yes :). The D ver was targeting code beauty, not speed. :|

> - Very often you can find performance problems in your language looking at how it performs compared to other languages. Here for example the threading in Phobos seems various times slower than the C++ version, that in the meantime was posted:
> http://shootout.alioth.debian.org/gp4/benchmark.php?test=chameneosredux&lang=gpp&id=0
> As you can see the C++ version takes 16.7 s, while your D version needs 41 s.

I have no idea. They only differ by 2 mem alloc calls.


More information about the Digitalmars-d-learn mailing list