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
Issue/257 #310
Conversation
@@ -0,0 +1,19 @@ | |||
extern crate lz4; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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::*; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
* 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
No description provided.