Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use libbrotli directly when available #1768

Merged
merged 1 commit into from Jan 2, 2018
Merged

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Dec 29, 2017

Tried to match coding style / design decisions done by other compression code.

Basic there-and-back-again test included, seems to properly fail if I inject extra bytes or corrupt a file.

Speed and size settings are the same as those in the tool (defaults);
tried copying okular from my system to brotli-compressed store before and after these changes and the resulting stores are close in size (183MB vs 184MB) and can be read using both methods.


  • Look for both 'brotli' and 'bro' as external command,
    since upstream has renamed it in newer versions.
    If neither are found, current runtime behavior
    is preserved: try to find 'bro' on PATH.
  • Limit amount handed to BrotliEncoderCompressStream
    to ensure interrupts are processed in a timely manner.
    Testing shows negligible performance impact.
    (Other compression sinks don't seem to require this)

* Look for both 'brotli' and 'bro' as external command,
  since upstream has renamed it in newer versions.
  If neither are found, current runtime behavior
  is preserved: try to find 'bro' on PATH.
* Limit amount handed to BrotliEncoderCompressStream
  to ensure interrupts are processed in a timely manner.
  Testing shows negligible performance impact.
  (Other compression sinks don't seem to require this)
@dtzWill dtzWill changed the title use brotli API instead of external command use libbrotli directly when available Dec 31, 2017
@dtzWill
Copy link
Member Author

dtzWill commented Dec 31, 2017

Updated:

  • Better interrupt behavior when compressing large strings
  • brotli not hard dependency, due to ubuntu/fedora missing packages for it in the releases used
  • General formatting and other cleanups

@edolstra edolstra merged commit 9b67f23 into NixOS:master Jan 2, 2018
@edolstra
Copy link
Member

edolstra commented Jan 2, 2018

Thanks @dtzWill!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants