798ce0db28
Provides versions, on average, are about 34 times longer that Requires versions. More precisely, if we consider all rpmsetcmp calls for "apt-shell <<<unmet" command, then sum(c1)/sum(c2)=33.88. This means that we can save some time and instructions by skipping intermediate bytes - in other words, by stepping a few bytes at a time. Of course, after all the bytes are skipped, we must recheck a few final bytes and possibly step back. Also, this requires more than one sentinel for proper boundary checking. This change implements two such "steppers" - 4-byte stepper for c1/c2 ratio below 16 and 8-byte stepper which is used otherwise. When stepping back, both steppers use bisecting. Note that replacing last two bisecting steps with a simple loop might be actually more efficient with respect to branch prediction and CPU's BTB. It is very hard to measure any user time improvement, though, even in a series of 100 runs. The improvement is next to none, at least on older AMD CPUs. And so I choose to keep bisecting. callgrind annotations for "apt-shell <<<unmet", previous commit: 2,279,520,414 PROGRAM TOTALS 646,107,201 lib/set.c:decode_base62_golomb 502,438,804 lib/set.c:rpmsetcmp 98,243,148 sysdeps/x86_64/memcmp.S:bcmp 93,038,752 sysdeps/x86_64/strcmp.S:__GI_strcmp callgrind annotations for "apt-shell <<<unmet", this commit: 2,000,254,692 PROGRAM TOTALS 642,039,009 lib/set.c:decode_base62_golomb 227,036,590 lib/set.c:rpmsetcmp 98,247,798 sysdeps/x86_64/memcmp.S:bcmp 93,047,422 sysdeps/x86_64/strcmp.S:__GI_strcmp |
||
---|---|---|
.. | ||
.lclintrc | ||
al.c | ||
al.h | ||
closeall.c | ||
cpio.c | ||
cpio.h | ||
depends.c | ||
depends.h | ||
formats.c | ||
fs.c | ||
fsm.c | ||
fsm.h | ||
getdate.y | ||
header_internal.c | ||
header_internal.h | ||
header.h | ||
Makefile.am | ||
manifest.c | ||
manifest.h | ||
misc.c | ||
misc.h | ||
order.c | ||
package.c | ||
poptI.c | ||
poptK.c | ||
poptQV.c | ||
problems.c | ||
psm.c | ||
psm.h | ||
query.c | ||
rpmchecksig.c | ||
rpmcli.h | ||
rpminstall.c | ||
rpmlead.c | ||
rpmlead.h | ||
rpmlib.h | ||
rpmlibprov.c | ||
rpmrc.c | ||
set.c | ||
set.h | ||
signature.c | ||
signature.h | ||
stringbuf.c | ||
stringbuf.h | ||
transaction.c | ||
verify.c |