Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

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
Task Type Feature Request
Category
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Low
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

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
   list_c.patch (5.2 KiB)
   list_h.patch (0.6 KiB)
   pacman_c.patch (1.4 KiB)
This task depends upon

Closed by  Judd Vinet (judd)
Monday, 04 October 2004, 00:45 GMT
Reason for closing:  Implemented
Comment by Judd Vinet (judd) - Saturday, 25 September 2004, 18:20 GMT
Cool, thanks!

I'll look at it for 2.9.3.
Comment by Tobias Kieslich (tobias) - Monday, 27 September 2004, 22:38 GMT
Allthough it's not this issue, I like to add another observation, that the new feature of package size for download returned a wrong value. It showed 0.1 MB but downloaded more than 3MB from staging. I could verify that on a second box:
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.
Comment by Judd Vinet (judd) - Tuesday, 28 September 2004, 05:00 GMT
Yea, sync databases need to be rebuilt with the newest version of gensync, otherwise they don't store the package sizes.

Loading...