rpm-build/lib
Alexey Tourbin 798ce0db28 set.c: implemented 4-byte and 8-byte steppers for rpmsetcmp main loop
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
2012-03-15 07:02:09 +04:00
..
.lclintrc re-added .lclintrc and .cvsignore files from CVS 2002-03-25 20:27:37 +00:00
al.c system.h: moved AUTO_REALLOC from depends.h 2011-01-06 03:26:09 +03:00
al.h al.c: removed extra arguments in alAllSatisfiesDepend 2009-10-04 12:44:38 +04:00
closeall.c fixed compilation 2003-11-24 19:20:13 +00:00
cpio.c Added SELinux support 2010-08-24 16:59:07 +00:00
cpio.h Added SELinux support 2010-08-24 16:59:07 +00:00
depends.c system.h: moved AUTO_REALLOC from depends.h 2011-01-06 03:26:09 +03:00
depends.h system.h: moved AUTO_REALLOC from depends.h 2011-01-06 03:26:09 +03:00
formats.c Migrate to new libbeecrypt 2010-08-12 20:41:06 +00:00
fs.c lib/fs.c (getFilesystemList): Drop "/mnt" support 2007-03-27 15:41:38 +00:00
fsm.c fsmStage: be careful with file permissions on package removal or upgrade 2011-11-30 17:07:27 +00:00
fsm.h Added SELinux support 2010-08-24 16:59:07 +00:00
getdate.y Initial revision 2002-03-25 20:16:26 +00:00
header_internal.c lib/header_internal.c (headerGetLangs): Fix stupid X<=Y<=Z comparison 2009-09-24 11:36:29 +04:00
header_internal.h header.c: backported headerSetInstance() and headerGetInstance() from rpm.org 2010-08-22 02:16:02 +04:00
header.h header.h: shut up -Wextra warning 2011-01-03 09:52:38 +03:00
Makefile.am spec, lib/Makefile.am: compile and run set.c in -DSELF_TEST mode 2011-06-07 10:50:10 +04:00
manifest.c rpmReadPackageManifest: Fix comments handling 2008-04-08 15:28:53 +00:00
manifest.h Initial revision 2002-03-25 20:16:26 +00:00
misc.c relocated _noDirTokens, compressFilelist, expandFilelist, providePackageNVR from lib to rpmdb 2005-10-15 16:30:13 +00:00
misc.h transaction.c: revamped decideFileFate() akin to filecmp() 2009-03-09 20:11:22 +03:00
order.c removed ancient dependency loop whiteout mechanism (rpm.org) 2011-01-23 02:30:59 +03:00
package.c package.c (readPackageHeaders): use posix_fadvise(2) to disable readahead 2009-05-10 23:32:48 +04:00
poptI.c removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
poptK.c sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
poptQV.c removed --fileid query selector and Filemd5s rpmdb index (rpm.org) 2011-01-22 17:35:13 +03:00
problems.c s/relocateable/relocatable/ (jbj) 2009-03-08 20:12:18 +03:00
psm.c removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
psm.h removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
query.c removed --fileid query selector and Filemd5s rpmdb index (rpm.org) 2011-01-22 17:35:13 +03:00
rpmchecksig.c sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
rpmcli.h removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
rpminstall.c removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
rpmlead.c sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
rpmlead.h Include local headers. 2006-05-15 03:26:57 +04:00
rpmlib.h removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
rpmlibprov.c rpmlibprov.c: added rpmlib(SetVersions) feature 2010-09-11 01:58:23 +04:00
rpmrc.c rpmrc.c (is_pentiumN): Add models with nonzero extended model 2009-12-20 15:06:21 +00:00
set.c set.c: implemented 4-byte and 8-byte steppers for rpmsetcmp main loop 2012-03-15 07:02:09 +04:00
set.h set.c: minor cleanup and English fixes 2011-06-14 00:00:54 +04:00
signature.c build/files.c, lib/signature.c: Do not include unused md5.h 2008-11-12 05:29:08 +03:00
signature.h Include local headers. 2006-05-15 03:26:57 +04:00
stringbuf.c Initial revision 2002-03-25 20:16:26 +00:00
stringbuf.h Initial revision 2002-03-25 20:16:26 +00:00
transaction.c removed support for repackaging and rollbacks (rpm.org) 2011-09-23 02:47:36 +04:00
verify.c verify.c: updated verifyDependencies() for self-conflicting packages 2010-08-22 02:30:13 +04:00