Skip to content

Commit

Permalink
feat: cost of for is ~0
Browse files Browse the repository at this point in the history
We fairly often perform FoR and then do not perform bitpacking because
we have exceeded the depth. FoR is very cheap and only worthwhile in
combination with bitpacking anyway, so setting its cost to zero should
improve compression ratio with a minor decrease in compresssion speed.
  • Loading branch information
danking committed Oct 2, 2024
1 parent 389e6a4 commit 601e840
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vortex-sampling-compressor/src/compressors/for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ impl EncodingCompressor for FoRCompressor {
FoR::ID.as_ref()
}

fn cost(&self) -> u8 {
0
}

fn can_compress(&self, array: &Array) -> Option<&dyn EncodingCompressor> {
// Only support primitive arrays
let parray = PrimitiveArray::try_from(array).ok()?;
Expand Down

0 comments on commit 601e840

Please sign in to comment.