FS#1520 - [Patch] Pacman 2.9 list handling performance very bad
Attached to Project:
Pacman
Opened by Tommi Rantala (ttrantal) - Saturday, 25 September 2004, 07:28 GMT
Last edited by Judd Vinet (judd) - Saturday, 25 September 2004, 18:18 GMT
Opened by Tommi Rantala (ttrantal) - Saturday, 25 September 2004, 07:28 GMT
Last edited by Judd Vinet (judd) - Saturday, 25 September 2004, 18:18 GMT
|
Details
Current pacman list implementation chokes on large lists
giving very poor performance.
The problem lies in the fact that list_add() uses list_last(), which in turn goes through the whole list to find the last item in the list. I modified the list handling a bit, adding a direct link from the first item in the list to the last item in the list. The performance boost is quite impressive. Patches are provided, hope I didnt break anything else... 'pacman' is pacman-2.9 and './pacman' is patched pacman-2.9. Test run 1: list kdelibs info: ============================== $ time pacman -Qi kdelibs Name : kdelibs Version : 3.3.0-3 Groups : kde Packager : Arch Linux (http://www.archlinux.org) URL : http://www.kde.org License : Architecture : i686 Size : 156424169 Build Date : Wed Sep 15 20:19:28 2004 UTC Install Date : Sat Sep 18 06:28:09 2004 UTC Install Script : Yes Reason: : explicitly installed Provides : None Depends On : arts=1.3.0 bzip2 cups fam lesstif libart-lgpl libidn libxslt openldap openssl pcre perl Required By : k3b kaffeine kdebase kdegames kdegraphics kdemultimedia kdesdk kdeutils mozillaqs okle oooqs Conflicts With : None Description : KDE Core Libraries real 0m13.187s user 0m12.596s sys 0m0.143s $ time ./pacman -Qi kdelibs Name : kdelibs Version : 3.3.0-3 Groups : kde Packager : Arch Linux (http://www.archlinux.org) URL : http://www.kde.org License : Architecture : i686 Size : 156424169 Build Date : Wed Sep 15 20:19:28 2004 UTC Install Date : Sat Sep 18 06:28:09 2004 UTC Install Script : Yes Reason: : explicitly installed Provides : None Depends On : arts=1.3.0 bzip2 cups fam lesstif libart-lgpl libidn libxslt openldap openssl pcre perl Required By : k3b kaffeine kdebase kdegames kdegraphics kdemultimedia kdesdk kdeutils mozillaqs okle oooqs Conflicts With : None Description : KDE Core Libraries real 0m0.085s user 0m0.032s sys 0m0.043s Test run 2: list all files of all installed packages: ===================================================== $ time pacman -Ql >all_orig_pacman real 0m26.267s user 0m24.933s sys 0m0.430s $ time ./pacman -Ql >all real 0m0.567s user 0m0.333s sys 0m0.211s $ ls -l all* -rw-r--r-- 1 ttrantal users 9590909 Sep 24 19:20 all -rw-r--r-- 1 ttrantal users 9590909 Sep 24 19:20 all_orig_pacman $ md5sum all* 2e6dc07cef349d54d021900308bec2a9 all 2e6dc07cef349d54d021900308bec2a9 all_orig_pacman |
This task depends upon
list_c.patch
I'll look at it for 2.9.3.
http://www.justdreams.de/archlinux/images/screenies/pacman_dl-size3.png
see the mlterm output.
and here from another box:
[root@buran tobias]# pacman -S arch-artwork
Targets: arch-artwork-0.2-s1
Total Package Size: 0.1 MB
Proceed with upgrade? [Y/n]
:: Retrieving packages from staging...
arch-artwork-0.2-s1 [################] 100% 3821K 85.9K/s 00:00:44
checking package integrity... done.
loading package data... done.
checking for file conflicts... done.
installing arch-artwork... done.
Artwork is installed in /usr/share/arch-artwork. Certain things like splash screens have to be set up manually.
Read /usr/share/arch-artwork/README for instructions and details.
Read /usr/share/arch-artwork/CREDITS for authors and download locations.
[root@buran tobias]#
I think pacman takes the size from the database, so I don't know it's miscalculation of size or a wrong entry in the db.
I just don't wanna file a new bug report, cuz' it's a very minor issue.