FSST-Rust
A pure rust implementation of the Fast Static Symbol Table.
Quick to use
use cargo add
or add fsst-rust to Cargo.toml
[dependencies]
fsst-rust = "0.1.1"
Usage
de/compress a single string
let str = "tumcwitumvldb";
let = encode_string;
println!; // [b, t, w, tumc, witumvld]
assert_eq!;
let table_bytes = symbol_table.dump;
let decoder = from_table_bytes;
assert_eq!;
let compress_factor = str.len as f64 / encoding.len as f64;
println!;
batch de/compress strings
let compress_file_path = "assets/test_data/ps_comment".to_string;
let strings = read_string_lines.unwrap;
let mut start_time = now;
let = encode_all_strings;
let compress_time = start_time.elapsed;
start_time = now;
let decode_strings = decode_all_strings;
let decompress_time = start_time.elapsed;
let mut encoding_size = symbol_table.dump.len;
let mut total_size = 0;
for i in 0..strings.len
let compress_factor = total_size as f64 / encoding_size as f64;
println!;
println!;
println!;
MircoBench
cargo bench
MircoBench Environment:
Architecture: x86_64
Model name: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
compression on TPC-H data of ps_comment at string level

decompression on TPC-H data of l_comment at string level

License
FSST-Rust is under the Apache-2.0 license. See the LICENSE file for details.
Acknowledgement
Thanks to the authors Peter Boncz, Thomas Neumann, and Viktor Leis for providing the powerful FSST. Here is the original algorithm repository: https://github.com/cwida/fsst.