On Thu, 2006-12-07 at 12:19 +0100, Ćukasz Lew wrote: > Big thanks from me for that. :) > > Have You tried to use C and D together?
That's a very good question. I probably still could use D for the GO program simply by making the low level functions C code. The whole D program right now is 7K of source even with the debug routines. I'll try this with the Mersenne twister random number generator which is C code - that will be a good test of how easy or difficult it is to use C. The page claims it's trivial and that ironically it's easy to interface with C, but not C++. I noticed there are a lot of benchmarks where D is faster than C, on the language shootout page. I haven't looked to see how fair this is. I also don't know if I'm writing the D code the best way (although it is almost the same as C.) I will check it out: http://www.tiobe.com/tpci.htm - Don > BTW > D is geting more popular recently. > http://www.tiobe.com/tpci.htm > > Lukasz > > On 12/7/06, Don Dailey <[EMAIL PROTECTED]> wrote: > > Ok, here is my report on the D language for Go: > > > > The gdc (gnu D compiler) compiler for D is a bit better if you tune the > > options and there are a few more options to tinker with. It actually > > helped me find a bug (it is more anal) that probably made the other > > tests I reported invalid. The D program is now only 1.47 times slower > > than the equivalent C program, and even the digital mars compiler is ok > > but not quite as fast. > > > > It's still too slow for my taste but I'm still trying to find out if I'm > > doing all I can do. It's possible there may be language idioms I should > > be using or better ways to do things in D that I don't know about. > > > > I do really like it - It's c++ without all the warts and lots of > > improvements. There are versions for windows, unix, Macs. I may > > start using it for other things - but probably not computer GO unless I > > can get it closer to C speed. > > > > Here are the numbers: > > > > The equivalent C version (after I took out some optimizations) is > > doing 13,745.70 games per second on an old pentium 4. > > > > My best D version is doing 9,327.49 games per second. > > > > The most optimized C version is doing 16,398.82 games per second. > > These same extra optimizations could be applied to the D version and I > > think it would help as much or even more - I manually unrolled some > > loops to save some branching and memory indirection. > > > > Dave Dyer think the extra 50% running time isn't that important but I > > know from my own scalability experiments that Lazarus running at this > > 1.47 handicap would be noticeably weaker on CGOS. I might accept the > > slowdown if it were more like 1.25, for the extra convenience. This > > language is very good at helping you with bugs - checking array bounds > > problems etc. > > > > > > - Don > > > > > > > > > > On Wed, 2006-12-06 at 22:11 -0500, Don Dailey wrote: > > > On Wed, 2006-12-06 at 17:54 -0800, steve uurtamo wrote: > > > > > I'll see if I can figure out what options turn on > > > > > all the speed now ... > > > > > > > > C > > > > > > > > :) > > > > > > > > s. > > > > > > You might be right. I finally found the useful switches which were "-O > > > -release -inline" > > > and it did speed things up, but I'm still almost 2.4 times slower than > > > the equivalent C version with the best optimizations. > > > > > > That's way too much for me - pity I would really enjoy working in this > > > language. > > > > > > One more thing to try - there is a gcc version I will try. > > > > > > I wonder if the object oriented stuff hurts it? Does anyone know if > > > that poses a lot of extra overhead in say c++? Almost the whole > > > program is contained and working from inside the class I defined to > > > encapsulate most of the functionality. > > > > > > > > > - Don > > > > > > > > > > > > > _______________________________________________ > > computer-go mailing list > > computer-go@computer-go.org > > http://www.computer-go.org/mailman/listinfo/computer-go/ > > _______________________________________________ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/