About 7 months ago, I wrote about we had improved Lintian’s performance. In 2.5.41, we are doing another memory reduction, where we primarily reduce the memory consumption of data about ELF binaries. Like previously, memory reductions follows the “less is more” pattern.
My initial test subject was linux-image-4.4.0-trunk-rt-686-pae_4.4-1~exp1_i386.deb. It had a somewhat unique property that the ELF data made up a little over half the cache.
- We do away with a lot of unnecessary default values [f4c57bb, 470875f]
- That removed about ~3MB (out of 10.56MB) of that ELF data cache
- Discard section information we do not use [3fd98d9]
- This reduced the ELF data cache to 2MB (down from the 7MB).
- Then we stop caching the output of file(1) twice [7c2bee4]
- While a fairly modest reduction (only 0.80MB out of 16MB total), it also affects packages without ELF binaries.
At this point, we had reduced the total memory usage from 18.35MB to 8.92MB (the ELF data going from 10.56MB to 1.98MB). At this point, I figured that I was happy with the improvement and discarded my test subject.
While impressive, the test subject was unsurprisingly a special case. The improvement in “regular” packages (with ELF binaries) were closer to 8% in total. Not being satisfied with that, I pulled one more trick.
- Keep only “UND” and “.text” symbols [2b21621]
- This brought coreutils (just the lone deb) another 10% memory reduction in total.
In the grand total, coreutils 8.24-1 amd64 went from 4.09MB to 3.48MB. The ELF data cache went from 3.38MB to 2.84MB. Similarly, libreoffice/4.2.5-1 (including its ~170 binaries) has also seen a 8.5% reduction in total cache size and is now down to 260.48MB (from 284.83MB).
 If you are wondering why I in 3fd98d9 wrote “The total “cache” memory usage is approaching 1/3 of the original for that package”, then you are not alone. I am not sure myself any more, but it seems obviously wrong.
 FTR: The sample size of “regular packages” is 2 in this case. Of which one of them being coreutils…
 Admittedly, since “take 2” and not since 18.104.22.168 like the rest.