Skip to content

Commit 6760549

Browse files
authored
Restore some missing data from benchmarks (#6914)
I've missed some data from benchmarks, this change brings back data to one charts and generates other data again Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent f19aa8c commit 6760549

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

benchmarks-website/server.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ function formatQuery(q) {
135135
return q.toUpperCase().replace(/[_-]/g, " ");
136136
}
137137

138+
function normalizeChartName(group, chartName) {
139+
if (group === "Compression Size" && chartName === "VORTEX FILE COMPRESSED SIZE") {
140+
return "VORTEX SIZE";
141+
}
142+
return chartName;
143+
}
144+
138145
// LTTB downsampling
139146
function lttbIndices(seriesMap, target) {
140147
const keys = [...seriesMap.keys()];
@@ -298,6 +305,7 @@ async function refresh() {
298305
seriesName = rename(parts[1] || "default");
299306
chartName = formatQuery(parts[0]);
300307
}
308+
chartName = normalizeChartName(group, chartName);
301309
if (chartName.includes("PARQUET-UNC")) return;
302310

303311
// Skip throughput metrics (keep only time/size)

vortex-bench/src/compress/mod.rs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ pub fn calculate_ratios(
178178
ratios: &mut Vec<CustomUnitMeasurement>,
179179
) {
180180
calculate_vortex_parquet_ratios(measurements, compressed_sizes, bench_name, ratios);
181+
calculate_vortex_lance_ratios(measurements, compressed_sizes, bench_name, ratios);
181182
}
182183

183184
fn calculate_vortex_parquet_ratios(
@@ -225,3 +226,100 @@ fn calculate_vortex_parquet_ratios(
225226
});
226227
}
227228
}
229+
230+
fn calculate_vortex_lance_ratios(
231+
measurements: &HashMap<(Format, CompressOp), Duration>,
232+
compressed_sizes: &HashMap<Format, u64>,
233+
bench_name: &str,
234+
ratios: &mut Vec<CustomUnitMeasurement>,
235+
) {
236+
// Size ratio: vortex vs lance.
237+
if let (Some(vortex_size), Some(lance_size)) = (
238+
compressed_sizes.get(&Format::OnDiskVortex),
239+
compressed_sizes.get(&Format::Lance),
240+
) {
241+
ratios.push(CustomUnitMeasurement {
242+
name: format!("vortex:lance size/{bench_name}"),
243+
format: Format::OnDiskVortex,
244+
unit: Cow::from("ratio"),
245+
value: *vortex_size as f64 / *lance_size as f64,
246+
});
247+
}
248+
249+
// Compress time ratio: vortex vs lance.
250+
if let (Some(vortex_time), Some(lance_time)) = (
251+
measurements.get(&(Format::OnDiskVortex, CompressOp::Compress)),
252+
measurements.get(&(Format::Lance, CompressOp::Compress)),
253+
) {
254+
ratios.push(CustomUnitMeasurement {
255+
name: format!("vortex:lance ratio compress time/{bench_name}"),
256+
format: Format::OnDiskVortex,
257+
unit: Cow::from("ratio"),
258+
value: vortex_time.as_nanos() as f64 / lance_time.as_nanos() as f64,
259+
});
260+
}
261+
262+
// Decompress time ratio: vortex vs lance.
263+
if let (Some(vortex_time), Some(lance_time)) = (
264+
measurements.get(&(Format::OnDiskVortex, CompressOp::Decompress)),
265+
measurements.get(&(Format::Lance, CompressOp::Decompress)),
266+
) {
267+
ratios.push(CustomUnitMeasurement {
268+
name: format!("vortex:lance ratio decompress time/{bench_name}"),
269+
format: Format::OnDiskVortex,
270+
unit: Cow::from("ratio"),
271+
value: vortex_time.as_nanos() as f64 / lance_time.as_nanos() as f64,
272+
});
273+
}
274+
}
275+
276+
#[cfg(test)]
277+
mod tests {
278+
use std::time::Duration;
279+
280+
use super::*;
281+
282+
#[test]
283+
fn calculate_ratios_adds_vortex_lance_metrics() {
284+
let mut timings = HashMap::new();
285+
timings.insert(
286+
(Format::OnDiskVortex, CompressOp::Compress),
287+
Duration::from_millis(20),
288+
);
289+
timings.insert(
290+
(Format::Lance, CompressOp::Compress),
291+
Duration::from_millis(10),
292+
);
293+
timings.insert(
294+
(Format::OnDiskVortex, CompressOp::Decompress),
295+
Duration::from_millis(12),
296+
);
297+
timings.insert(
298+
(Format::Lance, CompressOp::Decompress),
299+
Duration::from_millis(6),
300+
);
301+
302+
let mut compressed_sizes = HashMap::new();
303+
compressed_sizes.insert(Format::OnDiskVortex, 400);
304+
compressed_sizes.insert(Format::Lance, 200);
305+
306+
let mut ratios = Vec::new();
307+
calculate_ratios(&timings, &compressed_sizes, "demo", &mut ratios);
308+
309+
assert!(
310+
ratios
311+
.iter()
312+
.any(|m| m.name == "vortex:lance size/demo" && m.value == 2.0)
313+
);
314+
assert!(
315+
ratios
316+
.iter()
317+
.any(|m| { m.name == "vortex:lance ratio compress time/demo" && m.value == 2.0 })
318+
);
319+
assert!(
320+
ratios
321+
.iter()
322+
.any(|m| { m.name == "vortex:lance ratio decompress time/demo" && m.value == 2.0 })
323+
);
324+
}
325+
}

0 commit comments

Comments
 (0)