diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-12-15 20:57:32 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-12-15 22:13:12 +0100 |
commit | c6d40932f81edc656bbcc8dbd9d277aba543bc5b (patch) | |
tree | 83119f8e12d44a5d1da0c589c4489b675c8fbbd8 /apt-pkg/pkgcachegen.h | |
parent | 5afd3ff6834430bb252ce5a37686bf1481f7c590 (diff) |
Unroll pkgCache::sHash 8 time, break up dependency
Unroll pkgCache::sHash 8 times and break up the dependency between
the iterations by expanding the calculation
H(n) = 33 * H(n-1) + c
8 times rather than performing it 8 times. This seems to yield about
a 0.4% performance improvement.
I tried unrolling 4 and 2 bytes as well, those only having 3 ifs at
the end rather than 1 small loop; but that was actually slower -
potentially the code got to large and the cache went bonkers.
I also tried unrolling 4 times instead of 8, thinking that smaller
code might yield better results overall then, but that was slower as
well.
Diffstat (limited to 'apt-pkg/pkgcachegen.h')
0 files changed, 0 insertions, 0 deletions