The 48 megabyte executable The 48 megabyte executable

Fresh back to work after my Japan vacation, I was doing some gameplay additions today when I noticed that my compile times seemed too long. Normally builds run from about 5 seconds to about 25 seconds, depending on whether you're building one or two files or the whole project. But suddenly, if recompiling a single file was taking more like 15 seconds.

Looking into the matter, I discovered that somehow, the executable responsible for code generation had ballooned to 48 megabytes. The executable, mind you. So merely the act of executing the code generator was actually eating up the extra 10 seconds, as Windows laboriously processed a ridiculous amount of code.

It turned out to be a simple case of overzealous array sizing. Since it's just a bunch of hack code that doesn't need to ship or anything, there's a bunch of hard-coded arrays in there that got a little out of hand with their maximum dimensions :) The ten-second fix of changing it to an allocation instead of a static variable eliminated the problem completely.

So, no harm done, but it was still quite the unusual experience for me to happen upon a 48 megabyte executable!


Authored by casey on 2008-11-03 23:13:50

(no contents)