dpkg: Use FIEMAP to sort .list files before scanning
When running dpkg from a cold cache on a system where <admindir>/info/
lies on a hard disk, a lot of time is spent waiting for seeks between
(typically) thousands of files. This patch changes the behavior of
ensure_allinstfiles_available(), so that it accesses the packages in
the order of their .list files' physical locations on the hard disk,
greatly reducing drive head movements.
The performance improvement is around 70% on my system: reinstalling
a simple package takes 8 seconds instead of 27 seconds. The caches were
dropped before each run, and 10 runs were done with consistent results.
The performance is identical to the previous patch using FIBMAP,
althought this one has the advantage of not needing root privileges.
Signed-off-by: Guillem Jover <guillem@debian.org>
parent
b3ffabc0
Please register or sign in to comment