long compile time 2.023 (few lines of code)

Saaa empty at needmail.com
Fri Jan 23 15:19:02 PST 2009


>
> allocating 40MB of static data seems a bit excessive.
>
> 1. Your exectuable is probably going to be 40MB (not sure)
> 2. allocating on the heap is probably going to be faster than this, as the 
> OS would not have to read 40MB of static data from the disk.
>
> Is there a reason why you want to do it this way instead of:
>
> Struct[] structs;
> static this
> {
>   structs = new Struct[1_000_000];
> }
>
> -Steve
My executable is only 177KB




More information about the Digitalmars-d-learn mailing list