a45456493b
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] |
||
---|---|---|
.. | ||
.lclintrc | ||
db3.c | ||
dbconfig.c | ||
fprint.c | ||
fprint.h | ||
hdrinline.h | ||
hdrNVR.c | ||
header.c | ||
jhash.h | ||
legacy.c | ||
Makefile.am | ||
merge.c | ||
poptDB.c | ||
rpmdb.c | ||
rpmdb.h | ||
rpmhash.c | ||
rpmhash.h | ||
rpmvercmp.c | ||
tagname.c |