This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from AndrewSisley/f64
Upgrade f64 to cql_model v.2
- Loading branch information
Showing
10 changed files
with
399 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub const DATABASE_LOCATION: &str = "./.test_db"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#![feature(test)] | ||
mod constants; | ||
extern crate test; | ||
|
||
use constants::DATABASE_LOCATION; | ||
use test::Bencher; | ||
use cql_f64::F64; | ||
use cql_storage_type_testing_lib::benches::read_single; | ||
|
||
#[bench] | ||
fn _1d_f64_single_point_read_location_1(b: &mut Bencher) { | ||
let test_fn = read_single::_1d_read_location_1::<F64>(DATABASE_LOCATION, 42.6); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _1d_f64_single_point_read_location_100000(b: &mut Bencher) { | ||
let test_fn = read_single::_1d_read_location_100000::<F64>(DATABASE_LOCATION, 42.6); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_single_point_read_location_1_1_1_1(b: &mut Bencher) { | ||
let test_fn = read_single::_4d_read_location_1_1_1_1::<F64>(DATABASE_LOCATION, 42.6); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_single_point_read_location_1_1_1_100000(b: &mut Bencher) { | ||
let test_fn = read_single::_4d_read_location_1_1_1_100000::<F64>(DATABASE_LOCATION, 5.3); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_single_point_read_location_1_100000_1_1(b: &mut Bencher) { | ||
let test_fn = read_single::_4d_read_location_1_100000_1_1::<F64>(DATABASE_LOCATION, 5.3); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#![feature(test)] | ||
mod constants; | ||
extern crate test; | ||
|
||
use std::io::{ Cursor }; | ||
use constants::DATABASE_LOCATION; | ||
use test::{ Bencher }; | ||
use cql_f64::{ unpack_stream, F64 }; | ||
use cql_storage_type_testing_lib::benches::read_stream; | ||
|
||
#[bench] | ||
fn _1d_f64_stream_read_location_1_to_1(b: &mut Bencher) { | ||
let test_fn = read_stream::_1d_read_empty_location_1_to_1::<F64>(DATABASE_LOCATION, &unpack_f64_stream); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _1d_f64_stream_read_location_50000_to_100000(b: &mut Bencher) { | ||
let test_fn = read_stream::_1d_read_empty_location_50000_to_100000::<F64>(DATABASE_LOCATION, &unpack_f64_stream); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_stream_read_location_1_1_1_1_to_1_1_1_1(b: &mut Bencher) { | ||
let test_fn = read_stream::_4d_read_empty_location_1_1_1_1_to_1_1_1_1::<F64>(DATABASE_LOCATION, &unpack_f64_stream); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_stream_read_location_1_1_1_50000_to_1_1_1_100000(b: &mut Bencher) { | ||
let test_fn = read_stream::_4d_read_empty_location_1_1_1_50000_to_1_1_1_100000::<F64>(DATABASE_LOCATION, &unpack_f64_stream); | ||
|
||
b.iter(|| { | ||
test_fn(); | ||
}); | ||
} | ||
|
||
fn unpack_f64_stream (stream: &mut Cursor<Vec<u8>>, n_values: usize, result: &mut [f64]) { | ||
unpack_stream(stream, n_values, |idx, value| { | ||
result[idx] = value | ||
}).unwrap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#![feature(test)] | ||
mod constants; | ||
extern crate test; | ||
|
||
use constants::DATABASE_LOCATION; | ||
use test::Bencher; | ||
use cql_f64::F64; | ||
use cql_storage_type_testing_lib::benches::write_single; | ||
|
||
#[bench] | ||
fn _1d_f64_single_point_write_location_1(b: &mut Bencher) { | ||
let test_fn = write_single::_1d_write_location_1::<F64>(DATABASE_LOCATION); | ||
|
||
b.iter(|| { | ||
test_fn(42.6); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _1d_f64_single_point_write_location_100000(b: &mut Bencher) { | ||
let test_fn = write_single::_1d_write_location_100000::<F64>(DATABASE_LOCATION); | ||
|
||
b.iter(|| { | ||
test_fn(42.6); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_single_point_write_location_1_1_1_1(b: &mut Bencher) { | ||
let test_fn = write_single::_4d_write_location_1_1_1_1::<F64>(DATABASE_LOCATION); | ||
|
||
b.iter(|| { | ||
test_fn(5.3); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_single_point_write_location_1_1_1_100000(b: &mut Bencher) { | ||
let test_fn = write_single::_4d_write_location_1_1_1_100000::<F64>(DATABASE_LOCATION); | ||
|
||
b.iter(|| { | ||
test_fn(5.3); | ||
}); | ||
} | ||
|
||
#[bench] | ||
fn _4d_f64_single_point_write_location_1_100000_1_1(b: &mut Bencher) { | ||
let test_fn = write_single::_4d_write_location_1_100000_1_1::<F64>(DATABASE_LOCATION); | ||
|
||
b.iter(|| { | ||
test_fn(5.3); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub const DATABASE_LOCATION: &str = "./.test_db"; |
Oops, something went wrong.