Can we drop static struct initializers?

bearophile bearophileHUGS at lycos.con
Fri Nov 20 02:25:51 PST 2009


I've used static struct initializers because somehow the dmd optimizer is able to produce more efficient code. If you replace the C-style static struct initializers in this program with D ones (the ones like Foo(1, 2)) the program gets slower:
http://shootout.alioth.debian.org/debian/benchmark.php?test=nbody&lang=gdc&id=1

Maybe dmd doesn't see D-style static struct initializers as true compile-time constants, I don't know. I think LDC doesn't share this problem/limit.

Bye,
bearophile



More information about the Digitalmars-d mailing list