@@ -7,8 +7,6 @@ use std::time::Instant;
77
88use clap:: Parser ;
99use indicatif:: ProgressBar ;
10- use vortex:: buffer:: Buffer ;
11- use vortex:: buffer:: buffer;
1210use vortex_bench:: BenchmarkOutput ;
1311use vortex_bench:: Engine ;
1412use vortex_bench:: Format ;
@@ -54,7 +52,7 @@ async fn main() -> anyhow::Result<()> {
5452 setup_logging_and_tracing ( args. verbose , args. tracing ) ?;
5553
5654 // Row count of the dataset is 3,339,715.
57- let indices = buffer ! [ 10u64 , 11 , 12 , 13 , 100_000 , 3_000_000 ] ;
55+ let indices = vec ! [ 10u64 , 11 , 12 , 13 , 100_000 , 3_000_000 ] ;
5856
5957 run_random_access (
6058 args. formats ,
@@ -81,6 +79,14 @@ async fn get_accessor(format: Format) -> anyhow::Result<Box<dyn RandomAccessor>>
8179 let path = taxi_data_parquet ( ) . await ?;
8280 Ok ( Box :: new ( ParquetRandomAccessor :: new ( path) ) )
8381 }
82+ #[ cfg( feature = "lance" ) ]
83+ Format :: Lance => {
84+ use lance_bench:: random_access:: LanceRandomAccessor ;
85+ use lance_bench:: random_access:: taxi_data_lance;
86+
87+ let path = taxi_data_lance ( ) . await ?;
88+ Ok ( Box :: new ( LanceRandomAccessor :: new ( path) ) )
89+ }
8490 _ => unimplemented ! ( "Random access bench not implemented for {format}" ) ,
8591 }
8692}
@@ -91,7 +97,7 @@ async fn get_accessor(format: Format) -> anyhow::Result<Box<dyn RandomAccessor>>
9197/// collecting timing for each run.
9298async fn benchmark_random_access (
9399 accessor : & dyn RandomAccessor ,
94- indices : & Buffer < u64 > ,
100+ indices : & [ u64 ] ,
95101 time_limit_secs : u64 ,
96102 storage : & str ,
97103) -> anyhow:: Result < TimingMeasurement > {
@@ -101,9 +107,9 @@ async fn benchmark_random_access(
101107
102108 // Run at least once, then continue until time limit
103109 loop {
104- let indices_clone = indices. clone ( ) ;
110+ let indices = indices. to_vec ( ) ;
105111 let start = Instant :: now ( ) ;
106- let _row_count = accessor. take ( indices_clone ) . await ?;
112+ let _row_count = accessor. take ( indices ) . await ?;
107113 runs. push ( start. elapsed ( ) ) ;
108114
109115 if overall_start. elapsed ( ) >= time_limit {
@@ -124,6 +130,8 @@ fn format_to_engine(format: Format) -> Engine {
124130 match format {
125131 Format :: OnDiskVortex | Format :: VortexCompact => Engine :: Vortex ,
126132 Format :: Parquet => Engine :: Arrow ,
133+ #[ cfg( feature = "lance" ) ]
134+ Format :: Lance => Engine :: Arrow , // Is this right here?
127135 _ => Engine :: default ( ) ,
128136 }
129137}
@@ -135,7 +143,7 @@ async fn run_random_access(
135143 formats : Vec < Format > ,
136144 time_limit : u64 ,
137145 display_format : DisplayFormat ,
138- indices : Buffer < u64 > ,
146+ indices : Vec < u64 > ,
139147 output_path : Option < PathBuf > ,
140148) -> anyhow:: Result < ( ) > {
141149 let progress = ProgressBar :: new ( formats. len ( ) as u64 ) ;
0 commit comments