[greedy] Fix performance instability
parent
c3e921c639
commit
70c80e19e6
|
@ -681,6 +681,12 @@ ZSTD_compressBlock_lazy_generic(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Match Loop */
|
/* Match Loop */
|
||||||
|
#if defined(__GNUC__) && defined(__x86_64__)
|
||||||
|
/* I've measured random a 5% speed loss on levels 5 & 6 (greedy) when the
|
||||||
|
* code alignment is perturbed. To fix the instability align the loop on 32-bytes.
|
||||||
|
*/
|
||||||
|
__asm__(".p2align 5");
|
||||||
|
#endif
|
||||||
while (ip < ilimit) {
|
while (ip < ilimit) {
|
||||||
size_t matchLength=0;
|
size_t matchLength=0;
|
||||||
size_t offset=0;
|
size_t offset=0;
|
||||||
|
@ -952,6 +958,12 @@ size_t ZSTD_compressBlock_lazy_extDict_generic(
|
||||||
ip += (ip == prefixStart);
|
ip += (ip == prefixStart);
|
||||||
|
|
||||||
/* Match Loop */
|
/* Match Loop */
|
||||||
|
#if defined(__GNUC__) && defined(__x86_64__)
|
||||||
|
/* I've measured random a 5% speed loss on levels 5 & 6 (greedy) when the
|
||||||
|
* code alignment is perturbed. To fix the instability align the loop on 32-bytes.
|
||||||
|
*/
|
||||||
|
__asm__(".p2align 5");
|
||||||
|
#endif
|
||||||
while (ip < ilimit) {
|
while (ip < ilimit) {
|
||||||
size_t matchLength=0;
|
size_t matchLength=0;
|
||||||
size_t offset=0;
|
size_t offset=0;
|
||||||
|
|
Loading…
Reference in New Issue