Bug#248037: package-versions is extremly slow
When I install d-i on something which is probasbly not the most modern
hardware, but still a usable system, the "Gathering information for
installation report" step takes ages. I thought it is discover being
run, but I just found out it's package-versions... it takes about 50
seconds on this system... changing the script to use:
grep "^\(Package\|Version\):" /var/lib/dpkg/status | \
bring it down to about 10 seconds.
An even faster variant is:
grep "^\(Package\|Version\):" /var/lib/dpkg/status | sed -e 's/^[^:]+: //' | \
while read package ; do
echo "$package $version"
However, this won't work on a normal system because
/var/lib/dpkg/status may contain information about "Package:", but
not "Version:". However, I think on d-i we always have Package +
Version because nothing is being removed.
In any case, package-versions is definitely a case where optimization