June 03, 2011
On 6/3/11 6:09 PM, Adam D. Ruppe wrote:
> bearophile wrote:
>> My modified C++0x code:
>> First D2 translation that seems to work:
>
> What timings did you get? On my computer, the D version ran
> slightly faster (56 seconds vs 63s for C++) without optimizations
> turned on.
>
> With optimizations turned on, C++ took a nice lead (28 seconds vs 53
> seconds for D).

What are your timings for the Java, Scala, and Go versions?

Thanks,

Andrei
June 03, 2011
Andrei Alexandrescu wrote:
> What are your timings for the Java, Scala, and Go versions?

I don't have compilers nor the code for those languages, so I don't know.
June 04, 2011
I must be doing something wrong. Do I have to pipe some files to the module or something?

I've compiled it and ran it, it's done in 1.5 seconds. :s
June 04, 2011
Oh I think it's that stack overflow thing bear was talking about? Because it quits after this with no message:

Welcome to LoopTesterApp, D edition
Constructing App...
Constructing Simple CFG...
15000 dummy loops
Constructing CFG...
Performing Loop Recognition
1 Iteration
June 04, 2011
Okay, here's how to increase stack size via Optlink:
dmd benchmark.d -L/STACK:128000000
June 04, 2011
On 2011-06-03 17:16, Andrej Mitrovic wrote:
> I must be doing something wrong. Do I have to pipe some files to the module or something?
> 
> I've compiled it and ran it, it's done in 1.5 seconds. :s

Or maybe you just have a way better machine?

- Jonathan M Davis
June 04, 2011
Andrej Mitrovic:

> Okay, here's how to increase stack size via Optlink:
> dmd benchmark.d -L/STACK:128000000

Keep in mind that sets the max stack size, not the max heap size. -L/STACK:5000000 is plenty :-)

Bye,
bearophile
June 04, 2011
DMD debug: 50s
DMD optimized: 49s (-release -noboundscheck -O -inline -L/STACK:1280000000)

That's around 1GB of stack memory.
Compiling with GDC will make the app throw an exception at runtime due
to the stack being blown, the error message isn't special but it's
better than no error message.

GDC debug: 1m:24s
GDC optimized: 1m:12s (gdc -v2 -O3 -Wl,--stack,1280000000)

I haven't tested the other ones. Does Go have a Windows compiler yet?
June 04, 2011
On 6/4/11, bearophile <bearophileHUGS@lycos.com> wrote:
> Andrej Mitrovic:
>
>> Okay, here's how to increase stack size via Optlink:
>> dmd benchmark.d -L/STACK:128000000
>
> Keep in mind that sets the max stack size, not the max heap size. -L/STACK:5000000 is plenty :-)
>
> Bye,
> bearophile
>

Is that in bytes or kilobytes? Well, I guess Optlink/LD will automatically limit the stack size to something sane if I've blown it out of proportion. The app ends up using about 130megs.
June 04, 2011
Btw for those wondering, the paper's code is at http://code.google.com/p/multi-language-bench/