Merge pull request #2134 from terrelln/align-lazy
[greedy] Fix performance instability
This commit is contained in:
commit
ad34d58218
@ -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
Block a user