Skip to content

Commit f8dc9b9

Browse files
committed
fix
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 11488c1 commit f8dc9b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+199
-471
lines changed

bench-vortex/rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imports_granularity = "Module"

bench-vortex/src/bench_run.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
use std::future::Future;
55
use std::hint::black_box;
6-
use std::time::Duration;
7-
use std::time::Instant;
6+
use std::time::{Duration, Instant};
87

98
use tokio::runtime::Runtime;
109

bench-vortex/src/benchmark_driver.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,15 @@ use log::warn;
1212
use vortex::error::VortexExpect;
1313
use vortex_datafusion::metrics::VortexMetricsFinder;
1414

15-
use crate::Engine;
16-
use crate::Format;
17-
use crate::Target;
1815
use crate::benchmark_trait::Benchmark;
19-
use crate::df;
2016
use crate::display::DisplayFormat;
21-
use crate::engines::EngineCtx;
22-
use crate::engines::benchmark_datafusion_query;
23-
use crate::measurements::MemoryMeasurement;
24-
use crate::measurements::QueryMeasurement;
17+
use crate::engines::{EngineCtx, benchmark_datafusion_query};
18+
use crate::measurements::{MemoryMeasurement, QueryMeasurement};
2519
use crate::memory::BenchmarkMemoryTracker;
26-
use crate::metrics::MetricsSetExt;
27-
use crate::metrics::export_plan_spans;
28-
use crate::query_bench::filter_queries;
29-
use crate::query_bench::print_memory_usage;
30-
use crate::query_bench::print_results;
31-
use crate::utils::new_tokio_runtime;
32-
use crate::utils::url_scheme_to_storage;
33-
use crate::vortex_panic;
20+
use crate::metrics::{MetricsSetExt, export_plan_spans};
21+
use crate::query_bench::{filter_queries, print_memory_usage, print_results};
22+
use crate::utils::{new_tokio_runtime, url_scheme_to_storage};
23+
use crate::{Engine, Format, Target, df, vortex_panic};
3424

3525
/// Mode for EXPLAIN queries
3626
#[derive(Debug, Clone, Copy)]

bench-vortex/src/benchmark_trait.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
use anyhow::Result;
77
use url::Url;
88

9-
use crate::BenchmarkDataset;
10-
use crate::Engine;
11-
use crate::Format;
12-
use crate::Target;
13-
use crate::df;
149
use crate::engines::EngineCtx;
10+
use crate::{BenchmarkDataset, Engine, Format, Target, df};
1511

1612
/// Core benchmark operations that all benchmark types implement
1713
pub trait Benchmark {

bench-vortex/src/bin/compress.rs

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,33 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use std::fs::File;
5-
use std::io::Write;
6-
use std::io::stdout;
5+
use std::io::{Write, stdout};
76
use std::path::PathBuf;
87
use std::time::Duration;
98

10-
use bench_vortex::Engine;
11-
use bench_vortex::Format;
12-
use bench_vortex::Target;
13-
use bench_vortex::compress::bench::CompressMeasurements;
14-
use bench_vortex::compress::bench::CompressOp;
15-
use bench_vortex::compress::bench::{self as compress};
9+
use bench_vortex::compress::bench::{
10+
CompressMeasurements, CompressOp, {self as compress},
11+
};
1612
use bench_vortex::datasets::Dataset;
1713
use bench_vortex::datasets::struct_list_of_ints::StructListOfInts;
1814
use bench_vortex::datasets::taxi_data::TaxiData;
19-
use bench_vortex::datasets::tpch_l_comment::TPCHLCommentCanonical;
20-
use bench_vortex::datasets::tpch_l_comment::TPCHLCommentChunked;
21-
use bench_vortex::display::DisplayFormat;
22-
use bench_vortex::display::print_measurements_json;
23-
use bench_vortex::display::render_table;
15+
use bench_vortex::datasets::tpch_l_comment::{TPCHLCommentCanonical, TPCHLCommentChunked};
16+
use bench_vortex::display::{DisplayFormat, print_measurements_json, render_table};
2417
use bench_vortex::downloadable_dataset::DownloadableDataset;
25-
use bench_vortex::measurements::CompressionTimingMeasurement;
26-
use bench_vortex::measurements::CustomUnitMeasurement;
18+
use bench_vortex::measurements::{CompressionTimingMeasurement, CustomUnitMeasurement};
2719
use bench_vortex::public_bi::PBI_DATASETS;
28-
use bench_vortex::public_bi::PBIDataset::Arade;
29-
use bench_vortex::public_bi::PBIDataset::Bimbo;
30-
use bench_vortex::public_bi::PBIDataset::CMSprovider;
31-
use bench_vortex::public_bi::PBIDataset::Euro2016;
32-
use bench_vortex::public_bi::PBIDataset::Food;
33-
use bench_vortex::public_bi::PBIDataset::HashTags;
34-
use bench_vortex::setup_logging_and_tracing;
20+
use bench_vortex::public_bi::PBIDataset::{Arade, Bimbo, CMSprovider, Euro2016, Food, HashTags};
3521
use bench_vortex::utils::new_tokio_runtime;
22+
use bench_vortex::{Engine, Format, Target, setup_logging_and_tracing};
3623
use clap::Parser;
3724
use indicatif::ProgressBar;
3825
use itertools::Itertools;
3926
use regex::Regex;
4027
use tokio::runtime::Runtime;
41-
use vortex::Array;
42-
use vortex::IntoArray;
43-
use vortex::arrays::ChunkedArray;
44-
use vortex::arrays::ChunkedVTable;
28+
use vortex::arrays::{ChunkedArray, ChunkedVTable};
4529
use vortex::builders::builder_with_capacity;
4630
use vortex::utils::aliases::hash_map::HashMap;
31+
use vortex::{Array, IntoArray};
4732

4833
#[derive(Parser, Debug)]
4934
#[command(version, about, long_about = None)]

bench-vortex/src/bin/public_bi.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,22 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use std::fs::File;
5-
use std::io::Write;
6-
use std::io::stdout;
5+
use std::io::{Write, stdout};
76
use std::path::PathBuf;
87
use std::time::Instant;
98

10-
use bench_vortex::BenchmarkDataset;
11-
use bench_vortex::Format;
12-
use bench_vortex::Target;
13-
use bench_vortex::df;
14-
use bench_vortex::display::DisplayFormat;
15-
use bench_vortex::display::print_measurements_json;
16-
use bench_vortex::display::render_table;
9+
use bench_vortex::display::{DisplayFormat, print_measurements_json, render_table};
1710
use bench_vortex::measurements::QueryMeasurement;
1811
use bench_vortex::metrics::MetricsSetExt;
19-
use bench_vortex::public_bi::FileType;
20-
use bench_vortex::public_bi::PBI_DATASETS;
21-
use bench_vortex::public_bi::PBIDataset;
22-
use bench_vortex::setup_logging_and_tracing;
12+
use bench_vortex::public_bi::{FileType, PBI_DATASETS, PBIDataset};
2313
use bench_vortex::utils::constants::STORAGE_NVME;
2414
use bench_vortex::utils::new_tokio_runtime;
25-
use clap::Parser;
26-
use clap::value_parser;
15+
use bench_vortex::{BenchmarkDataset, Format, Target, df, setup_logging_and_tracing};
16+
use clap::{Parser, value_parser};
2717
use indicatif::ProgressBar;
2818
use itertools::Itertools;
29-
use tracing::Instrument;
30-
use tracing::info_span;
31-
use vortex::error::VortexExpect;
32-
use vortex::error::vortex_panic;
19+
use tracing::{Instrument, info_span};
20+
use vortex::error::{VortexExpect, vortex_panic};
3321
use vortex_datafusion::metrics::VortexMetricsFinder;
3422

3523
#[derive(Parser, Debug)]

bench-vortex/src/bin/query_bench.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@
33

44
use std::path::PathBuf;
55

6-
use bench_vortex::IdempotentPath as _;
7-
use bench_vortex::Target;
8-
use bench_vortex::benchmark_driver::DriverConfig;
9-
use bench_vortex::benchmark_driver::run_benchmark;
10-
use bench_vortex::clickbench::ClickBenchBenchmark;
11-
use bench_vortex::clickbench::Flavor;
6+
use bench_vortex::benchmark_driver::{DriverConfig, run_benchmark};
7+
use bench_vortex::clickbench::{ClickBenchBenchmark, Flavor};
128
use bench_vortex::display::DisplayFormat;
139
use bench_vortex::fineweb::Fineweb;
1410
use bench_vortex::realnest::gharchive::GithubArchive;
15-
use bench_vortex::setup_logging_and_tracing;
1611
use bench_vortex::statpopgen::StatPopGenBenchmark;
1712
use bench_vortex::tpcds::TpcDsBenchmark;
1813
use bench_vortex::tpch::tpch_benchmark::TpcHBenchmark;
19-
use clap::Parser;
20-
use clap::Subcommand;
21-
use clap::value_parser;
14+
use bench_vortex::{IdempotentPath as _, Target, setup_logging_and_tracing};
15+
use clap::{Parser, Subcommand, value_parser};
2216
use url::Url;
2317

2418
#[derive(Parser, Debug)]

bench-vortex/src/bin/random_access.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,27 @@
33

44
use std::fs::File;
55
use std::future::Future;
6-
use std::io::Write;
7-
use std::io::stdout;
6+
use std::io::{Write, stdout};
87
use std::path::PathBuf;
98

10-
use bench_vortex::Engine;
11-
use bench_vortex::Format;
12-
use bench_vortex::Target;
139
use bench_vortex::bench_run::run_timed_with_setup;
1410
use bench_vortex::datasets::taxi_data::*;
15-
use bench_vortex::display::DisplayFormat;
16-
use bench_vortex::display::print_measurements_json;
17-
use bench_vortex::display::render_table;
11+
use bench_vortex::display::{DisplayFormat, print_measurements_json, render_table};
1812
use bench_vortex::measurements::TimingMeasurement;
1913
#[cfg(feature = "lance")]
2014
use bench_vortex::random_access::take::take_lance;
21-
use bench_vortex::random_access::take::take_parquet;
22-
use bench_vortex::random_access::take::take_vortex_tokio;
23-
use bench_vortex::setup_logging_and_tracing;
15+
use bench_vortex::random_access::take::{take_parquet, take_vortex_tokio};
2416
use bench_vortex::utils::constants::STORAGE_NVME;
2517
use bench_vortex::utils::new_tokio_runtime;
18+
use bench_vortex::{Engine, Format, Target, setup_logging_and_tracing};
2619
use clap::Parser;
2720
use indicatif::ProgressBar;
2821
use tokio::runtime::Runtime;
29-
use vortex::Array;
30-
use vortex::ArrayRef;
31-
use vortex::ToCanonical;
32-
use vortex::buffer::Buffer;
33-
use vortex::buffer::buffer;
22+
use vortex::buffer::{Buffer, buffer};
3423
use vortex::dtype::Nullability::NonNullable;
3524
use vortex::error::VortexExpect;
3625
use vortex::scalar::Scalar;
26+
use vortex::{Array, ArrayRef, ToCanonical};
3727

3828
#[derive(Parser, Debug)]
3929
#[command(version, about, long_about = None)]

bench-vortex/src/clickbench/clickbench_benchmark.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ use tokio::runtime::Runtime;
99
use url::Url;
1010
use vortex::error::VortexExpect;
1111

12-
use crate::BenchmarkDataset;
13-
use crate::CompactionStrategy;
14-
use crate::Format;
15-
use crate::IdempotentPath;
16-
use crate::Target;
1712
use crate::benchmark_trait::Benchmark;
1813
use crate::clickbench::*;
1914
use crate::engines::EngineCtx;
15+
use crate::{BenchmarkDataset, CompactionStrategy, Format, IdempotentPath, Target};
2016

2117
/// ClickBench benchmark implementation
2218
pub struct ClickBenchBenchmark {

bench-vortex/src/clickbench/clickbench_data.rs

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,39 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use std::fmt;
54
use std::fmt::Display;
6-
use std::fs;
75
use std::fs::File;
8-
use std::path::Path;
9-
use std::path::PathBuf;
10-
use std::sync::Arc;
11-
use std::sync::LazyLock;
6+
use std::path::{Path, PathBuf};
7+
use std::sync::{Arc, LazyLock};
128
use std::time::Duration;
9+
use std::{fmt, fs};
1310

14-
use arrow_schema::DataType;
15-
use arrow_schema::Field;
16-
use arrow_schema::Schema;
17-
use arrow_schema::TimeUnit;
11+
use arrow_schema::{DataType, Field, Schema, TimeUnit};
1812
use clap::ValueEnum;
1913
use datafusion::datasource::file_format::parquet::ParquetFormat;
20-
use datafusion::datasource::listing::ListingOptions;
21-
use datafusion::datasource::listing::ListingTable;
22-
use datafusion::datasource::listing::ListingTableConfig;
23-
use datafusion::datasource::listing::ListingTableUrl;
14+
use datafusion::datasource::listing::{
15+
ListingOptions, ListingTable, ListingTableConfig, ListingTableUrl,
16+
};
2417
use datafusion::prelude::SessionContext;
25-
use futures::StreamExt;
26-
use futures::TryStreamExt;
27-
use futures::stream;
18+
use futures::{StreamExt, TryStreamExt, stream};
2819
use glob::Pattern;
2920
use log::trace;
30-
use rayon::prelude::IntoParallelIterator;
31-
use rayon::prelude::ParallelIterator;
21+
use rayon::prelude::{IntoParallelIterator, ParallelIterator};
3222
use reqwest::IntoUrl;
3323
use reqwest::blocking::Response;
3424
use serde::Serialize;
35-
use tokio::fs::OpenOptions;
36-
use tokio::fs::create_dir_all;
37-
use tracing::Instrument;
38-
use tracing::info;
39-
use tracing::warn;
25+
use tokio::fs::{OpenOptions, create_dir_all};
26+
use tracing::{Instrument, info, warn};
4027
use url::Url;
4128
use vortex::error::VortexExpect;
4229
use vortex::file::WriteOptionsSessionExt;
4330
use vortex_datafusion::VortexFormat;
4431

45-
use crate::CompactionStrategy;
46-
use crate::Format;
47-
use crate::SESSION;
4832
use crate::conversions::parquet_to_vortex;
4933
#[cfg(feature = "lance")]
5034
use crate::utils;
51-
use crate::utils::file_utils::idempotent;
52-
use crate::utils::file_utils::idempotent_async;
35+
use crate::utils::file_utils::{idempotent, idempotent_async};
36+
use crate::{CompactionStrategy, Format, SESSION};
5337

5438
pub static HITS_SCHEMA: LazyLock<Schema> = LazyLock::new(|| {
5539
use DataType::*;

0 commit comments

Comments
 (0)