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

Issue/257 #310

Merged
merged 4 commits into from Jun 12, 2018
Merged

Issue/257 #310

merged 4 commits into from Jun 12, 2018

Conversation

fulmicoton
Copy link
Collaborator

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 91.156% when pulling 5c7aaa2 on issue/257 into 432d49d on master.

@@ -0,0 +1,19 @@
extern crate lz4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal (of putting the extern crate call here rather than lib.rs) being that we only "include the crate" in the library if that feature was enabled. Correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes... Alternative I could have added a #[cfg()] thing before hte statement in lib.rs.

src/store/mod.rs Outdated
trait Compression {
fn compress(uncompressed: &[u8], compress: &mut Vec<u8>);
fn decompress(compressed: &[u8], decompressed: &mut Vec<u8>);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to allow an eventual "plug and play"? I didn't see it being used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this.

#[cfg(not(feature="lz4"))]
mod compression_snap;
#[cfg(not(feature="lz4"))]
use self::compression_snap::*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, so by default we get snappy, but someone can turn on lz4 with the feature flag. Our snappy lib is a pure rust implementation, but lz4 requires a C library. Sweet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes... LZ4 is probably a nicer compresson/performance trade-off but not by a large margin.
This makes it easier to compile tantivy to web assembly.

@fulmicoton fulmicoton merged commit 0465876 into master Jun 12, 2018
@fulmicoton fulmicoton deleted the issue/257 branch June 12, 2018 10:03
drusellers pushed a commit to drusellers/tantivy that referenced this pull request Aug 18, 2018
* Replaced lz4 by a pure rust implementation of snappy.

Closes quickwit-oss#257

* snappy is the default compression. One can use lz4 by enabling the lz4 feature flag.

* Removed Compression trait
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

3 participants