summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-14 21:50:58 +0200
committerDan McGee <dan@archlinux.org>2011-10-14 21:58:12 +0200
commitae25167bcd592186749b79ea31b10fb78ed9fb2d (patch)
tree67b5239b72f4ebdc74aafba70a6d7ac722501c7e /lib/libalpm/sync.c
parentbf84dc4cf1b925cc3ac1fb3185efc50a21802ba4 (diff)
downloadpacman-ae25167bcd592186749b79ea31b10fb78ed9fb2d.tar.gz
pacman-ae25167bcd592186749b79ea31b10fb78ed9fb2d.tar.xz
Large performance improvement for check for owned directories
We can take a large shortcut here that saves us a lot of time, especially when upgrading packages with lots of directories. Obviously iterating the full file list of every single package to determine if this directory was present in any other package can take quite some time on a system with many packages installed. We don't need to remove a directory at all if we are upgrading a package and the version we are moving to still had the directory. Also make a small optimization on the package comparsion- we really only care about equality here, not the result of the compare, so we can shortcut using our name_hash. What kind of benefit does this give us? Oh, only a reduction from 295.7 million to 1.4 million strcmp() calls (99.5% fewer) during a `pacman -S linux libreoffice-common` operation. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
0 files changed, 0 insertions, 0 deletions