Optimizing Java using D

logicchains via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 21 02:50:25 PDT 2014


On Saturday, 21 June 2014 at 05:40:32 UTC, Tofu Ninja wrote:
> On another note, if someArray.sort() calls the built in sort 
> even when std.algorithm is imported, then most definitely built 
> in sort needs to go, I can see plenty of times where people 
> would not even realize they were calling the wrong sort or even 
> that there was an error in their code.

Sounds like a good idea; the only reason I didn't make that 
mistake myself was because I was calling sort on the output of 
partition rather than directly on the array.

Good news! I ran the D implementation using stable sort and the 
C++ implementation with input (2000,2000,2000), and while the C++ 
took 12m9s real, 10m23s user, the D only took 8m44s real, 7m41s 
user. So somehow the D's faster for really large input.


More information about the Digitalmars-d mailing list