Commit Graph

2275 Commits

Author SHA1 Message Date
Alexey Tourbin
e80861fd52 4.0.4-alt100.11
- build/files.c (addFile): Replaced myftw() with fts(3).
- build/checkFiles.c: Reimplemented check for unpackaged files using fts(3).
- python: Backported forceArray changes from rpm5.org (Alexander Myltsev).
2011-01-16 10:26:25 +03:00
Alexander Myltsev
d6701e921f python: backport forceArray changes from rpm5. 2011-01-16 10:18:05 +03:00
Alexander Myltsev
909e4fd5f2 Force array return type for RPMTAG_REQUIREFLAGS. 2011-01-16 10:18:02 +03:00
Alexey Tourbin
252c8b7aed build/checkFiles.c: reimplemented checkIntersect() using fiIntersect() 2011-01-15 11:49:07 +03:00
Alexey Tourbin
d3c57d3ee4 build/checkFiles.c: reimplemented checkFiles() using fts(3) 2011-01-15 11:48:33 +03:00
Alexey Tourbin
6528547c06 build/files.c: warn on fts error 2011-01-15 10:58:11 +03:00
Alexey Tourbin
324d08015d build/files.c (addFile): factored addFile1 to save lstat calls
When addFile() is called with file path obtained from specfile,
various checks must be performed, so that only valid paths can
enter the package.  However, when a path is passed down to fts,
it is no longer possible to obtain ill-formed paths.  So a lot
of lstat calls for intermediate path components can be saved.
2011-01-15 10:36:01 +03:00
Alexey Tourbin
161864908a build/files.c (addFile): replaced myftw() with fts(3) 2011-01-15 10:35:58 +03:00
Alexey Tourbin
d3842e8715 build/files.c (addFile): updated from rpm.org 2011-01-15 10:35:18 +03:00
Alexey Tourbin
592b51b3a3 build/files.c: removed ancient fl->prefix stuff 2011-01-14 22:11:52 +03:00
Alexey Tourbin
00ec5a8146 build/files.c: removed obsolete parseForRegexLang 2011-01-14 21:51:45 +03:00
Alexey Tourbin
1db852bde4 4.0.4-alt100.10
- platform.in: fixed %configure options for noarch packages.
2011-01-11 17:01:07 +03:00
Alexey Tourbin
4c9813bac8 platform.in: fixed %configure options for noarch packages
This introduces new macro %_configure_platform which will normally
expand to %_target_platform.  However, for noarch packages, a special
version called %_configure_platform_noarch will be used, which will use
%_host_cpu instead of mock "noarch" cpu.  Suggested by Dmitry V. Levin.

This fixes %configure failures like
checking build system type... Invalid configuration `noarch-alt-linux': machine `noarch-alt' not recognized
2011-01-11 16:28:27 +03:00
Alexey Tourbin
342aef732d 4.0.4-alt100.9
- set.c: Tweak LRU first-time insertion policy.
2011-01-07 07:00:15 +03:00
Alexey Tourbin
fad9df878b set.c: tweak LRU first-time insertion policy
Pushing new elements to the front tends to assign extra weight to that
elements, at the expense of other elements that are already in the cache.
The idea is then to try first-time insertion somewhere in the middle.
Further attempts suggest that the "pivot" should be closer to the end.

Cache performance for "apt-shell <<<unmet", previous commit:
hit=62375 miss=17252

Cache performance for "apt-shell <<<unmet", this commit:
hit=65085 miss=14542
2011-01-07 06:45:38 +03:00
Alexey Tourbin
cc5cafb9d7 4.0.4-alt100.8
- macro.c: Replaced repeated bsearch+qsort calls with custom
  bsearch+memmove-like routine; rpm startup time is now 10x faster.
2011-01-06 06:04:23 +03:00
Alexey Tourbin
05eb59911d macro.c: fixed macroTable corruption in freeArgs 2011-01-06 05:52:17 +03:00
Alexey Tourbin
d6e06cbbd5 build.c: adjust for macroTableSize change 2011-01-06 05:00:53 +03:00
Alexey Tourbin
6370ecd629 macro.c: replaced repeated bsearch+qsort with BSEARCH, 10x faster startup
"rpmquery rpm" callgrind annotations, previous commit:
86,825,432  PROGRAM TOTALS
33,090,616  ???:0x0000000000033080'2
25,635,193  ???:strcmp
11,530,816  ???:compareMacroName
 7,241,913  ???:memcpy
 2,008,600  ???:0x0000000000033080
 1,734,274  ???:sortMacroTable
   774,941  ???:doDefine
   642,062  ???:0x00000000000714c0
   308,897  ???:0x000000000002a7b0
   308,137  ???:do_lookup_x
   259,615  ???:0x0000000000070c50
   245,388  ???:poptReadConfigFile

"rpmquery rpm" callgrind annotations, this commit:
6,249,372  PROGRAM TOTALS
774,941  ???:doDefine
531,291  ???:addMacro
523,434  ???:0x00000000000714c0
388,985  ???:strcmp
308,897  ???:0x000000000002a7b0
308,098  ???:do_lookup_x
245,388  ???:poptReadConfigFile

"rpmquery rpm" repeated 100 times (user time), previous commit:
3.78s

"rpmquery rpm" repeated 100 times (user time), this commit:
0.40s
2011-01-06 04:04:18 +03:00
Alexey Tourbin
f332ec8636 bsearch.h: initial revision 2011-01-06 03:30:42 +03:00
Alexey Tourbin
add6349fea system.h: moved AUTO_REALLOC from depends.h 2011-01-06 03:26:09 +03:00
Alexey Tourbin
523b00db6e depends.c (rpmRangesOverlap): avoid extra strcmp calls 2011-01-06 03:24:14 +03:00
Alexey Tourbin
4d5831af27 strcasecmp.c: enhanced with table lookup 2011-01-06 03:22:55 +03:00
Alexey Tourbin
96d67572ce 4.0.4-alt100.7
- set.c: Reverted Kirill's changes.
- set.c: Applied aggressive optimization techniques (30% speed-up).
2011-01-04 11:14:18 +03:00
Alexey Tourbin
0f99bd9e13 spec: compile set.c with -fprofile-* options
callgrind results for "apt-cache unmet", 4.0.4-alt100.6:
2,215,614,910  PROGRAM TOTALS
1,126,021,045  ???:decode_set
  486,259,420  ???:rpmsetcmp
  147,177,041  ???:strcmp
   79,769,617  ???:strlen
   61,764,819  ???:0x0000000000033080'2
   54,573,169  ???:memcpy
   31,477,402  ???:strcpy
   24,471,167  ???:pkgCache::DepIterator::AllTargets()

callgrind results for "apt-cache unmet", this commit (built in hasher):
1,502,995,357  PROGRAM TOTALS
625,132,308  ???:decode_base62_golomb
374,940,745  ???:rpmsetcmp
 91,031,162  ???:strcmp
 69,615,481  ???:strlen
 61,764,819  ???:0x0000000000033080'2
 30,928,154  ???:memcpy
 26,108,178  ???:strcpy
 24,471,167  ???:pkgCache::DepIterator::AllTargets()

Average user time for "apt-shell <<<unmet", 4.0.4-alt100.6:
2.55s

Average user time for "apt-shell <<<unmet", this commit (built in hasher):
1.72s
2011-01-04 10:51:34 +03:00
Alexey Tourbin
9380d2ec53 tools/Makefile.am: compile setcmp.static, for profiling 2011-01-04 09:31:52 +03:00
Alexey Tourbin
afe9677742 tools/setcmp.c: with argc==1, read versions from stdin 2011-01-04 09:05:29 +03:00
Alexey Tourbin
cf36274cb9 header.h: shut up -Wextra warning
header.h: In function 'headerFreeData':
header.h:705:11: error: comparison between signed and unsigned integer expressions
2011-01-03 09:52:38 +03:00
Alexey Tourbin
42db4e0a9d set.c: final touches 2011-01-03 09:24:15 +03:00
Alexey Tourbin
73adeec07e set.c: cache short deltas
After base62+golomb decoding, most deltas are under 65536 (in Provides
versions, average delta should be around 1536).  So the whole version
can be stored using short deltas, effectively halving memory footprint.
However, this seems to be somewhat slower: per-delta copying and
decode_golomb must be invoked to recover hash values.  On the other
hand, this allows to increase cache size (128 -> 192).  But note that,
with larger cache sizes, LRU linear search will take longer.  So this is
a compromise - and apparently a favourable one.
2011-01-03 09:04:50 +03:00
Alexey Tourbin
b674d2bc31 set.c: tweak delta routines and maskv 2011-01-03 08:21:13 +03:00
Alexey Tourbin
ebe77a46cd set.c: avoid extra strcmp calls in the caching code 2011-01-03 08:21:12 +03:00
Alexey Tourbin
46f3968205 set.c: optimize array access in rpmsetcmp
callgrind results for "apt-cache unmet", 4.0.4-alt100.6:
2,198,298,537  PROGRAM TOTALS
1,115,738,267  lib/set.c:decode_set
  484,035,006  lib/set.c:rpmsetcmp
  143,078,002  ???:strcmp
   79,477,321  ???:strlen
   61,780,572  ???:0x0000000000033080'2
   54,466,947  ???:memcpy
   31,161,399  ???:strcpy
   24,438,336  ???:pkgCache::DepIterator::AllTargets()

callgrind results for "apt-cache unmet", this commit:
1,755,431,664  PROGRAM TOTALS
764,189,271  lib/set.c:decode_base62_golomb
404,493,494  lib/set.c:rpmsetcmp
143,076,968  ???:strcmp
 70,833,953  ???:strlen
 61,780,572  ???:0x0000000000033080'2
 54,466,947  ???:memcpy
 31,161,399  ???:strcpy
 24,438,336  ???:pkgCache::DepIterator::AllTargets()
2011-01-03 08:21:10 +03:00
Alexey Tourbin
d1ad36aef1 set.c: implemented combined base62+golomb decoding routine 2011-01-03 08:20:55 +03:00
Alexey Tourbin
bb21779d02 set.c: facilitate base62 decoding with table lookup 2011-01-03 02:06:07 +03:00
Alexey Tourbin
61866ee15a set.c: minor base62 tweaks 2011-01-03 02:05:11 +03:00
Alexey Tourbin
a2f26af268 set.c: reverted Kirill's changes 2011-01-02 06:39:32 +03:00
676a19a7af 4.0.4-alt100.6
- rpmRangesOverlap: Optimized out unneeded calls to printDepend().
- set.c: Cleaned up and optimized (Kirill Shutemov).
2010-12-07 17:43:44 +00:00
Kirill A. Shutemov
4b05315a84 set.c: optimize decode_golomb()
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
4d9409cb9c set.c: optimize putbits()
Use bit operations instead of cycles.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
6a9ce451bc set.c: use packed bitmap for bit vector
Currently, set.c uses array of chars to store bit vector. Each char
stores one bit: 0 or 1.

Let's use packed bitmap instead. It creates room for optimizations.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
6afa2793f8 set.c: cleanup self-tests
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
82a064020b set.c: use function-like syntax for sizeof.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
d7ece41758 set.c: do not mix declarations and code
Let's move variable declarations to the begin of blocks.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
82da3b0f49 set.c: slightly reformat code to increase its readability
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:57:43 +00:00
Kirill A. Shutemov
5c39279236 set.c: fixup self-test functions declaration
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:56:19 +00:00
Kirill A. Shutemov
4226027fbb set.c: get rid of nested functions
Nested function in C is GCC extension.
Let's try to follow ANSI C syntax.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:56:19 +00:00
Kirill A. Shutemov
75a4506d75 set.c, set.h: get rid of C++-style comments
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:56:19 +00:00
c7167f0395 lib/depends.c (rpmRangesOverlap): optimize out unneeded calls to printDepend()
This optimization speeds up rpmRangesOverlap() by 10%.
2010-12-04 17:30:16 +00:00
Alexey Tourbin
b7503c5d27 4.0.4-alt100.5
- set.c: Implemented LRU caching (2x speed-up, 1M footprint).
2010-12-04 13:34:18 +03:00