Static initializers  August 29, 2011  Globals and singletons are
already well-known as a design antipattern, but they have an
interesting additional cost. Consider a global (I include file-
level static in this category) value that has initialization
code. That code must be run at startup (which leads to the
static initialization order fiasco, though that is not the point
of this post).  Because this initialization code is run at
startup, before even main() is entered, it is in the critical
path for startup. It turns out that even simple code must be
paged in off disk, which can lead to disk seeks, and disk seeks
murder your startup performance.  This is not hypothetical: with
ChromeOS we found that innocuous-seeming static initializers in
Chrome were actually affecting the bottom line of startup
performance. (Note: that observation comes from a coworker; I'm
not sure whether he was using a non-SSD machine at the time or
if it also happens on SSDs. Just guessing, but paging in more
code, especially code that i