mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Potential quality 0 last distance improvement #305
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chylex on GitHub (Jan 28, 2020).
Originally assigned to: @eustas on GitHub.
In compress_fragment.c, the line resetting last distance is after the
emit_commandslabel:If the compressor later decides to continue the meta-block instead of starting a new one, it jumps back to that label and resets the last distance.
Is there any case where not resetting the last distance causes an issue? I tried moving the assignment before the label, and ran it on a mixed corpus (Canterbury, Silesia, Snappy test data, a mix of books in various languages, and html/css/js resources from popular websites) with the following results:
Spreadsheet with results, files that showed no difference are excluded.
You should be able to validate these results on files from publicly available corpuses, especially with the Silesia corpus where many files showed decent improvements and 2 files gained a few bytes.
If you think this would be a good change, and I didn't miss some issue with not resetting the last distance, I can make a PR with the change.
@eustas commented on GitHub (Aug 3, 2023):
Thanks. Will take a look soon