mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Custom dictionaries below level 5 #502
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 @rachel-bousfield on GitHub (Mar 26, 2024).
Custom dictionaries can be attached during compression and decompression using C APIs like
BrotliEncoderAttachPreparedDictionary. However, it appears they aren't used below brotli level 5. This causes a kind of silent failure where the user doesn't observe the lack of improvement.There's a few solutions to this issue
BrotliEncoderPrepareDictionarycould fail when an incompatible level is applied.Here's an example in case the issue isn't clear
@eustas commented on GitHub (Mar 26, 2024):
Thanks for reporting. I'll check and take action when I get spare cycles.
Agree, that at least CLI should let users know if dictionary is ignored.
@rachel-bousfield commented on GitHub (Mar 26, 2024):
I'd also look into how the C API could be improved. That's actually how I first discovered this issue. I was rather confused why my dictionary wasn't working :)
@pmeenan commented on GitHub (Apr 9, 2024):
FWIW, ZStandard allows for dictionary use down to 0 (though, practically you don't see big benefit until 2-3).
I don't know enough about brotli's actual encoding to know if it makes sense, but it could be useful to allow for dictionaries to work at the lower levels as well if that allows for lower CPU use but still decent savings.