www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Re: DMD 1.035 and 2.019 releases

reply bearophile <bearophileHUGS lycos.com> writes:
Walter Bright Wrote:
Bugzilla 2289: Stack overflow on very large BigInt to string.<

Around there are probably 10-20 systems able to compute integer operations efficiently, probably written in C, or C/asm. I have tested the performance of that D2 module and it's not good, Python runs circles around it and uses just a small fraction of the memory it uses, and GMP is something like hundreds times faster. As in the case of the regex module of the stdlib (that goes O(n*n) in too many situations), this seems a situation where it can be useful to borrow code (in C, probably) from other sources. Time ago people have told me that there are some license issues, so is the only hope to wait for someone to re-invent rounder wheels for D? (I presume Tango has a different regex module, but I don't see people backporting it to Phobos now, so I presume someone else will have to write yet another better regex module for Phobos?). Bye, bearophile
Sep 04 2008
parent reply Moritz Warning <moritzwarning web.de> writes:
On Thu, 04 Sep 2008 03:41:15 -0400, bearophile wrote:

 I have tested the
 performance of that D2 module and it's not good, Python runs circles
 around it and uses just a small fraction of the memory it uses, and GMP
 is something like hundreds times faster.

I have heard that BigInt is much faster in Tango. Maybe you could do a quick test? About the Tango regex, it has speed problems in many cases, too. http://dsource.org/projects/tango/ticket/1119
Sep 04 2008
parent bearophile <bearophileHUGS lycos.com> writes:
Moritz Warning:
 I have heard that BigInt is much faster in Tango. Maybe you could do a 
 quick test?

I don't use Tango, and so far I've failed to make Tangobos work well with my code.
 About the Tango regex, it has speed problems in many cases, too.

You can try this version of mine of the benchmark: http://shootout.alioth.debian.org/debian/benchmark.php?test=regexdna&lang=gdc&id=4 You can see lines marked with slow or SLOW, you can use them to replace the faster alternatives I have found, and you can see if Tango regex too is O(n*n) in that situation. Note that in that situation all the other regex engines are linear. Bye, bearophile
Sep 04 2008