Efficiency of immutable vs mutable

Andrew via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 2 19:16:06 PST 2015


I've written a short D program that involves many lookups into a 
static array. When I make the array immutable the program runs 
faster.  This must mean that immutable is more than a restriction 
on access, it must affect the compiler output. But why and how?

Thanks
Andrew



More information about the Digitalmars-d-learn mailing list