Skip to content

Commit

Permalink
Optimize XOR floating point compression (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
cswinter authored Apr 2, 2024
1 parent 62d0806 commit 59945ab
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 578 deletions.
56 changes: 56 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 138 additions & 2 deletions locustdb-compression-utils/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions locustdb-compression-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license-file = "../LICENSE"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "0.4"
bitbuffer = "0.10"

[dev-dependencies]
clap = { version = "4", features = ["derive"] }
Expand Down
7 changes: 5 additions & 2 deletions locustdb-compression-utils/examples/gorilla_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fn main() {
let opt = Opt::parse();

if let Some(mibibytes) = opt.benchmark {
assert!(!opt.single, "Benchmarking single precision is not supported");
assert!(opt.max_regret.len() == 1, "Benchmarking multiple max-regret values is not supported");
// create 1GiB of random floats
let len = (1 << 20) * mibibytes / 8;
Expand All @@ -59,7 +58,11 @@ fn main() {
let start_time = std::time::Instant::now();
let mut fast_rng = rand::rngs::SmallRng::seed_from_u64(42);
for _ in 0..len {
data.push(fast_rng.gen::<f64>());
if opt.single {
data.push(fast_rng.gen::<f32>() as f64);
} else {
data.push(fast_rng.gen::<f64>());
}
}
println!(
"Generated {mibibytes} MiB of random data in {:?}",
Expand Down
Loading

0 comments on commit 59945ab

Please sign in to comment.