Skip to content

Commit

Permalink
Merge pull request #85 from availproject/ghali/clean-bench
Browse files Browse the repository at this point in the history
WIP - clean benchmark
  • Loading branch information
markopoloparadox authored Apr 10, 2024
2 parents 9504cdd + 3bbf56b commit 78501c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kate/benches/reconstruct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub struct AppIdData {
pub data: Vec<u8>,
}

impl<'a> From<&'a AppIdData> for AppExtrinsic<'a> {
fn from(d: &'a AppIdData) -> Self {
AppExtrinsic::new(d.app_id, &d.data)
impl From<&AppIdData> for AppExtrinsic {
fn from(d: &AppIdData) -> Self {
AppExtrinsic::new(d.app_id, d.data.clone())
}
}

Expand Down Expand Up @@ -113,7 +113,7 @@ fn bench_reconstruct(c: &mut Criterion) {
for xts in xts_sets.into_iter() {
let size = xts
.iter()
.map(|app| app.opaque.len())
.map(|app| app.data.len())
.sum::<usize>()
.try_into()
.unwrap();
Expand Down Expand Up @@ -144,7 +144,7 @@ fn reconstruct(xts: &[AppExtrinsic]) {
let reconstructed = reconstruct_extrinsics(&lookup, extended_dims, columns).unwrap();
for ((app_id, data), xt) in reconstructed.iter().zip(xts) {
assert_eq!(app_id.0, *xt.app_id);
assert_eq!(data[0].as_slice(), xt.opaque);
assert_eq!(data[0].as_slice(), xt.data);
}

let dims_cols: u32 = dims.cols().into();
Expand Down

0 comments on commit 78501c7

Please sign in to comment.