Skip to content

Commit da6c8c3

Browse files
committed
Describe MacaqueTS using bullet list
1 parent 0711a36 commit da6c8c3

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

crates/modelardb_compression/src/models/macaque_v.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ impl MacaqueV {
175175
let factorized_epsilon = abs_error_bound / 2f32.powi(exponent);
176176
// Rewriting the last 23 - ⌈log2 factorized_epsilon⌉ mantissa bits
177177
// never exceeds the error bound. However, in that case, one more bit
178-
// can be rewritten if the majority of the least mantissa bits are 0.
179-
// Thus, we rewrite bits using 23 - ⌊log2 factorized_epsilon⌋ and
178+
// can be rewritten if the majority of the least significant mantissa bits
179+
// are 0. Thus, we rewrite bits using 23 - ⌊log2 factorized_epsilon⌋ and
180180
// perform an extra check to ensure the error bound is not exceeded.
181181
// If the error bound is exceeded, we rewrite 23 - ⌈log2 factorized_epsilon⌉
182-
// least mantissa bits.
182+
// least significant mantissa bits.
183183
let mut rewrite_position = 23 - factorized_epsilon.log2().abs().floor() as i32;
184184
let mut rewritten_value = f32::from_bits(rewrite_bits_by_n(value_as_u32, rewrite_position));
185185

@@ -319,7 +319,7 @@ pub fn grid(
319319
}
320320
}
321321

322-
// Extract the unbiased exponent from single precision float.
322+
// Extract the unbiased exponent from `value`.
323323
fn get_exponent(value: f32) -> i32 {
324324
let n_bits: u32 = value.to_bits();
325325
let biased_exponent = ((n_bits >> 23) & 0xff) as i32;

crates/modelardb_compression/src/models/timestamps.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@
1515

1616
//! Implementation of MacaqueTS, a lossless compression for timestamps. MacaqueTS uses
1717
//! optimized compression methods depending on the number of data points in a compressed segment
18-
//! and if its timestamps have been sampled at a regular sampling interval.
19-
//!
20-
//! - (1) If a segment only contains one data point, its timestamp is stored as both the segment's
18+
//! and if its timestamps have been sampled at a regular sampling interval:
19+
//! * If a segment only contains one data point, its timestamp is stored as both the segment's
2120
//! `start_time` and `end_time`.
22-
//! - (2) If a segment only contains two data points, the timestamps are stored as the segment's
21+
//! * If a segment only contains two data points, the timestamps are stored as the segment's
2322
//! `start_time` and `end_time`, respectively.
24-
//! - (3) If a segment contains more than two data points, the first and last timestamps
23+
//! * If a segment contains more than two data points, the first and last timestamps
2524
//! are stored as the segment's `start_time` and `end_time`, respectively, while its
26-
//! residual timestamps are compressed using one of two methods.
27-
//! - (1) If the data points in the segment have been collected at a regular sampling interval,
28-
//! the residual timestamps are compressed as the segment's length with the
29-
//! prefix zero bits stripped.
30-
//! - (2) If none of the above apply, an extended version of the compression method proposed
31-
//! for timestamps for the time series management system Gorilla in the [Gorilla paper]
32-
//! is used as a fallback.
25+
//! residual timestamps are compressed using one of two methods:
26+
//! * If the data points in the segment have been collected at a regular sampling interval,
27+
//! the residual timestamps are compressed as the segment's length with the
28+
//! prefix zero bits stripped.
29+
//! * If none of the above apply, an extended version of the compression method proposed
30+
//! for timestamps for the time series management system Gorilla in the [Gorilla paper]
31+
//! is used as a fallback.
3332
//!
3433
//! MacaqueTS extends Gorilla's timestamp compression method by using zero as the first delta
3534
//! instead of computing it explicitly. MacaqueTS also extends the flag ranges used by Gorilla

0 commit comments

Comments
 (0)