1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-03 10:51:47 -05:00
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
..
2010-03-14 19:46:59 -05:00
2010-09-06 11:20:51 -05:00
2010-03-14 19:46:59 -05:00
2010-03-14 19:46:59 -05:00
2010-12-12 20:08:54 -06:00
2010-03-14 19:46:59 -05:00
2010-12-13 21:25:14 -06:00
2010-12-13 21:16:47 -06:00
2010-12-12 20:29:05 -06:00
2010-12-14 11:50:50 -06:00
2010-12-12 20:08:54 -06:00
2010-12-12 20:29:30 -06:00
2010-03-14 19:46:59 -05:00
2010-12-12 20:29:59 -06:00
2010-03-14 19:46:59 -05:00
2010-03-14 19:46:59 -05:00
2010-03-14 19:46:59 -05:00
2010-03-14 19:46:59 -05:00
2010-03-14 19:46:59 -05:00
2008-06-03 21:31:31 -05:00
2010-03-14 19:46:59 -05:00
2010-03-14 19:46:59 -05:00
2010-12-12 19:53:20 -06:00
2010-03-14 19:46:59 -05:00
2010-12-14 11:56:32 -06:00
2010-05-04 23:38:52 -05:00