[Scummvm-devel] 256KB reduced binary size vs. speed

Max Horn max at quendi.de
Fri Mar 26 07:57:06 CET 2004


Hi folks,

I can cut down the size of our scummvm binaries by 256KB, at the cose 
of a potential small speed penalty on the HQ2x/HQ3x filters. I was 
wondering if it's worth the effort... in my case, it cuts down the 
binary from 3.1MB to 2.9 MB (about 8%) (stripped unoptimized build). 
This is achieved by converting the RGBtoYUV buffer from a global array, 
to a pointer to a malloc buffer.

This will cause a speed penalty on the HQ?x scalers, though, at least 
on some platforms (and in my case, also slightly increases the code 
size of them), because they now have to access the RGBtoYUV array 
through a "real" pointer; previously, the optimizer could make use of 
the fact that the location of the array was known (relative to the 
code).


I am now wondering, should I optimize for speed, or for size...


Cheers,

Max





More information about the Scummvm-devel mailing list