I haven't done any research, but I'm pretty confident the massive amount of inlining is to blame. Perhaps it may be time to take a serious look at which plugins really need to be inlined and which don't; this might even improve performance since more of the code could fit in the CPU cache.
One idea could also be a two-level system, where if someone defines something in the preprocessor density becomes a bit more conservative in what it inlines (e.g., have DENSITY_INLINE and DENSITY_ALWAYS_INLINE, and define the former as "" if DENSITY_DONT_ALWAYS_INLINE is defined). In this case, you could also add __attribute__((__hot__)) (for GCC at least, other compilers may have something similar) to DENSITY_ALWAYS_INLINE.
Thanks, you're right there is a massive amount of inlining.
I have started to tidy up the code base in 0.13.0 though, I'll integrate this maybe in some later version like 0.13.1.
[See http://encode.ru/threads/2313-Brotli?p=45406&viewfull=1#post45406 for more background]
I just checked the sizes of all the Squash plugins, and density is more than thrice the size of the next largest plugin (brotli):
I haven't done any research, but I'm pretty confident the massive amount of inlining is to blame. Perhaps it may be time to take a serious look at which plugins really need to be inlined and which don't; this might even improve performance since more of the code could fit in the CPU cache.
One idea could also be a two-level system, where if someone defines something in the preprocessor density becomes a bit more conservative in what it inlines (e.g., have
DENSITY_INLINE
andDENSITY_ALWAYS_INLINE
, and define the former as "" ifDENSITY_DONT_ALWAYS_INLINE
is defined). In this case, you could also add__attribute__((__hot__))
(for GCC at least, other compilers may have something similar) toDENSITY_ALWAYS_INLINE
.