rpm-build/rpmdb
Alexey Tourbin a45456493b header.c (findEntry): replaced bsearch with custom routine
Headers normally have around 64 tags, which means bsearch will issue
6 callbacks, only to perform a single instruction (a->tag - b->tag).

This also removes a bogus piece of code.

Here is how these optimizations will impact apt.  I remove
/var/cache/apt/*.bin and run "apt-cache show rpm".

4.0.4-alt100.11:
3,630,479,716  PROGRAM TOTALS
399,285,303  ???:0x0000000000033150'2 [libc-2.11.3.so]
319,106,185  ???:strlen [ld-2.11.3.so]
242,215,488  ???:pkgCache::FindPackage(char const*) [libapt-pkg-libc6.9-6.so.2.1.0]
198,711,478  ???:memcpy [ld-2.11.3.so]
198,594,999  ???:0x0000000000071970 [libc-2.11.3.so]
195,473,223  header.c:regionSwab.clone.2 [librpmdb-4.0.4.so]
135,707,034  ???:strcmp [ld-2.11.3.so]
117,134,836  header.c:dataLength [librpmdb-4.0.4.so]
102,919,244  ???:0x00000000000710f0 [libc-2.11.3.so]
102,291,091  ???:stpcpy [libc-2.11.3.so]
 75,555,843  ???:bsearch [libc-2.11.3.so]
 68,014,424  ???:getenv [libc-2.11.3.so]

this commit:
3,093,300,624  PROGRAM TOTALS
319,106,185  ???:strlen [ld-2.11.3.so]
242,215,488  ???:pkgCache::FindPackage(char const*) [libapt-pkg-libc6.9-6.so.2.1.0]
197,663,758  ???:0x0000000000071970 [libc-2.11.3.so]
185,771,577  header.c:regionSwab.clone.2 [librpmdb-4.0.4.so]
136,263,419  ???:strcmp [ld-2.11.3.so]
111,934,199  ???:memcpy [ld-2.11.3.so]
102,399,027  ???:0x00000000000710f0 [libc-2.11.3.so]
102,291,091  ???:stpcpy [libc-2.11.3.so]
 95,231,406  header.c:dataLength [librpmdb-4.0.4.so]
 76,706,744  ???:0x0000000000033150'2 [libc-2.11.3.so]
 68,359,227  header.c:findEntry [librpmdb-4.0.4.so]
 68,014,424  ???:getenv [libc-2.11.3.so]
2011-01-21 15:24:54 +03:00
..
.lclintrc re-added .lclintrc and .cvsignore files from CVS 2002-03-25 20:27:37 +00:00
db3.c db3.c (db3close): removed dobule close code (rpm5.org, RH#138589) 2009-04-23 16:48:19 +04:00
dbconfig.c further removed RPMDBI_DEPENDS 2010-07-12 10:02:00 +04:00
fprint.c fprint.h: turned entry.dirName into flexible array 2009-06-13 08:56:04 +04:00
fprint.h fprint.h: turned entry.dirName into flexible array 2009-06-13 08:56:04 +04:00
hdrinline.h relocated hdrinline.h and header.c from lib to rpmdb 2005-10-15 14:12:36 +00:00
hdrNVR.c relocated headerNVR() from lib to rpmdb; added headerNEVRA() to rpmdb 2005-10-15 15:03:18 +00:00
header.c header.c (findEntry): replaced bsearch with custom routine 2011-01-21 15:24:54 +03:00
jhash.h jhash.h, rpmhash.c: switch to Jenkins One-at-a-time hash 2009-03-26 11:19:01 +03:00
legacy.c removed _noDirTokens (producing legacy filelist format) 2009-06-17 06:32:18 +04:00
Makefile.am Added SELinux support 2010-08-24 16:59:07 +00:00
merge.c updated code to snapshot 2002-04-04 2002-04-05 08:04:32 +00:00
poptDB.c removed _noDirTokens (producing legacy filelist format) 2009-06-17 06:32:18 +04:00
rpmdb.c Added SELinux support 2010-08-24 16:59:07 +00:00
rpmdb.h Remove ancient, unused code to filter duplicates on rpmdb rebuild 2009-10-01 04:38:10 +04:00
rpmhash.c rpmhash.c (hashEqualityString): bare strcmp call 2009-03-26 11:20:50 +03:00
rpmhash.h jhash.h, rpmhash.c: switch to Jenkins One-at-a-time hash 2009-03-26 11:19:01 +03:00
rpmvercmp.c relocated rpmvercmp.c from lib to rpmdb 2005-10-15 14:44:31 +00:00
tagname.c further removed RPMDBI_DEPENDS 2010-07-12 10:02:00 +04:00