Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 committed Jul 10, 2024
1 parent 0680a0a commit a8726ee
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions bench-vortex/benches/random_access.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
use std::env;
use std::sync::Arc;

use bench_vortex::reader::{
take_parquet, take_parquet_object_store, take_vortex_object_store, take_vortex_tokio,
};
use bench_vortex::taxi_data::{taxi_data_parquet, taxi_data_vortex};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{black_box, Criterion, criterion_group, criterion_main};
use mimalloc::MiMalloc;
use object_store::aws::AmazonS3Builder;
use object_store::local::LocalFileSystem;
use tokio::runtime::Runtime;

use bench_vortex::reader::{
take_parquet, take_parquet_object_store, take_vortex_object_store, take_vortex_tokio,
};
use bench_vortex::taxi_data::{taxi_data_parquet, taxi_data_vortex};

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

const INDICES: [u64; 6] = [10, 11, 12, 13, 100_000, 3_000_000];

/// Benchmarks against object stores require setting
/// * AWS_ACCESS_KEY_ID
/// * AWS_SECRET_ACCESS_KEY
/// * AWS_BUCKET
/// * AWS_ENDPOINT
///
/// environment variables and assume files to read are already present
fn random_access_vortex(c: &mut Criterion) {
let mut group = c.benchmark_group("vortex");

Expand All @@ -37,13 +44,7 @@ fn random_access_vortex(c: &mut Criterion) {
})
});

let r2_fs = AmazonS3Builder::new()
.with_access_key_id(env::var("ACCESS_KEY_ID").unwrap())
.with_secret_access_key(env::var("SECRET_ACCESS_KEY").unwrap())
.with_endpoint("https://01e9655179bbec953276890b183039bc.r2.cloudflarestorage.com")
.with_bucket_name("vortex-test")
.build()
.unwrap();
let r2_fs = AmazonS3Builder::from_env().build().unwrap();
let r2_path =
object_store::path::Path::from_url_path(taxi_vortex.file_name().unwrap().to_str().unwrap())
.unwrap();
Expand All @@ -62,16 +63,7 @@ fn random_access_parquet(c: &mut Criterion) {
let mut group = c.benchmark_group("parquet");
group.sample_size(10);

let r2_fs = Arc::new(
AmazonS3Builder::new()
.with_access_key_id(env::var("ACCESS_KEY_ID").unwrap())
.with_secret_access_key(env::var("SECRET_ACCESS_KEY").unwrap())
.with_endpoint("https://01e9655179bbec953276890b183039bc.r2.cloudflarestorage.com")
.with_bucket_name("vortex-test")
.build()
.unwrap(),
);

let r2_fs = Arc::new(AmazonS3Builder::from_env().build().unwrap());
let taxi_parquet = taxi_data_parquet();
group.bench_function("tokio local disk", |b| {
b.to_async(Runtime::new().unwrap())
Expand Down

0 comments on commit a8726ee

Please sign in to comment.