On 10/5/12, Jakub Jelinek <ja...@redhat.com> wrote: > On Fri, Oct 05, 2012 at 01:59:18PM -0700, Lawrence Crowl wrote: > > With the constructor, you don't have to remember and you don't > > have to type more. If you have a variable, you know that it is > > properly initialized. > > But we really don't want hundreds or thousands of dynamic > constructors for global variables.
Nothing I have written requires a dynamic initializer for global variables. It may be that a dynamic initializer is the easiest implementation. If the cost is significant, we can fix it by applying the optimization, which would benefit our customers in addition to us. > For many people the time to compile (almost) empty file is very > important, we are already bad about that right now, initializing > too much stuff dynamically is going to make it worse. So far, we are looking at dynamic initializations that would take about 10 cycles. Even on a slow processor, a thousand initializations would take a microsecond. Our time reports don't even report anything less than 5 milliseconds. Is there any reason to believe that this anticipated static initialization overhead is not pretty low relative to other overhead? I'm thinking here of the fact that to even start, the driver launches cc1[plus] which has to parse all the options created by the driver. -- Lawrence Crowl