1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
pacman/lib/libalpm
Dan McGee 919bb6c9e0 Used hashed package name in _alpm_pkg_find
This results in huge gains to a lot of our codepaths since this is the most
frequent method of random access to packages in a list. The gains are seen
in both profiling and real life.

    $ pacman -Sii zvbi
    real: 0.41 sec -> 0.32 sec
    strcmp: 16,669,760 calls -> 473,942 calls
    _alpm_pkg_find: 52.73% -> 26.31% of time

    $ pacman -Su (no upgrades found)
    real: 0.40 sec -> 0.50 sec
    strcmp: 19,497,226 calls -> 524,097 calls
    _alpm_pkg_find: 52.36% -> 26.15% of time

There is some minor risk with this patch, but most of it should be avoided
by falling back to strcmp() if we encounter a package with a '0' hash value
(which we should not via any existing code path). We also do a strcmp once
hash values match to ensure against hash collisions. The risk left is that a
package name is modified once it was originally set, but the hash value is
left alone. That would probably result in a lot of other problems anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-14 12:36:02 -06:00
..
po Separate be_files into be_sync and be_local 2010-10-14 13:17:38 +10:00
.gitignore Remove unnecessary entries from .gitignore files 2007-07-16 16:49:28 -04:00
add.c Attempt to stop installation when we encounter problems 2010-12-12 21:42:41 -06:00
add.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
alpm_list.c alpm_list_diff_sorted - make some arguments const 2010-03-25 21:31:37 -05:00
alpm_list.h alpm_list_diff_sorted - make some arguments const 2010-03-25 21:31:37 -05:00
alpm.c Fix libfetch configure checking 2010-09-06 11:20:51 -05:00
alpm.h Display progress bar for disk space checking 2010-12-12 20:30:11 -06:00
backup.c Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
backup.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
be_local.c Abstract has_scriptlet() to package ops struct 2010-12-13 21:25:14 -06:00
be_package.c When setting package name, set hash value as well 2010-12-14 12:06:31 -06:00
be_sync.c Remove non-public functions from header 2010-12-13 21:16:47 -06:00
conflict.c alpm: don't expose alpm_depcmp 2010-12-12 20:08:54 -06:00
conflict.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
db.c Correctly force load of package reason 2010-12-13 21:25:14 -06:00
db.h Remove non-public functions from header 2010-12-13 21:16:47 -06:00
delta.c More consistent printing of off_t and time_t 2010-03-25 21:58:35 -05:00
delta.h Move MAX_DELTA_RATIO definition 2010-12-12 20:29:05 -06:00
deps.c Use _alpm_pkg_find in deps search 2010-12-14 11:50:50 -06:00
deps.h alpm: don't expose alpm_depcmp 2010-12-12 20:08:54 -06:00
diskspace.c diskspace style cleanups and small fixes 2010-12-12 20:32:05 -06:00
diskspace.h diskspace style cleanups and small fixes 2010-12-12 20:32:05 -06:00
dload.c Remove AC_TYPE_SIGNAL usage 2010-12-12 20:29:30 -06:00
dload.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
error.c Implement disk space checking 2010-12-12 20:29:59 -06:00
graph.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
group.c Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
group.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
handle.c Add configuration option to control disk space checking 2010-12-12 20:30:05 -06:00
handle.h Add configuration option to control disk space checking 2010-12-12 20:30:05 -06:00
log.c Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
log.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
Makefile.am Prototype disk space checking functionality 2010-12-12 20:29:37 -06:00
md5.c libalpm md5: use larger and dynamic buffer 2010-09-02 10:33:21 -05:00
md5.h libalpm/md5: Fix license header 2008-06-03 21:31:31 -05:00
package.c Used hashed package name in _alpm_pkg_find 2010-12-14 12:36:02 -06:00
package.h When setting package name, set hash value as well 2010-12-14 12:06:31 -06:00
remove.c alpm/remove.c : respect --dbonly during remove-upgrade 2010-12-12 20:19:24 -06:00
remove.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
sync.c Display progress bar for disk space checking 2010-12-12 20:30:11 -06:00
sync.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
trans.c Merge branch 'maint' 2010-12-12 19:53:20 -06:00
trans.h Bump copyright dates to 2010 2010-03-14 19:46:59 -05:00
util.c When setting package name, set hash value as well 2010-12-14 12:06:31 -06:00
util.h Add hash_sdbm function 2010-12-14 11:56:32 -06:00
version.c Remove call to function logger 2010-05-04 23:38:52 -05:00