Skip to content

Commit

Permalink
remove benches (until we have a messagestream impl)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-rms committed Aug 20, 2024
1 parent 38434b0 commit 1056c7c
Showing 1 changed file with 1 addition and 46 deletions.
47 changes: 1 addition & 46 deletions rust/benches/reader.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::{criterion_group, criterion_main, Criterion};
use mcap::{parse_record, Channel, Message, MessageStream, Schema};
use mcap::{Channel, Message, MessageStream, Schema};
use std::borrow::Cow;
use std::io::Cursor;
use std::sync::Arc;
Expand Down Expand Up @@ -79,51 +79,6 @@ fn bench_read_messages(c: &mut Criterion) {
}
});
});
#[cfg(feature = "tokio")]
{
use mcap::tokio::read::RecordReader;
use tokio::runtime::Builder;

let rt = Builder::new_current_thread().build().unwrap();
group.bench_function("AsyncMessageStream_1M_uncompressed", |b| {
b.to_async(&rt).iter(|| async {
let mut reader = RecordReader::new(Cursor::new(&mcap_data_uncompressed));
let mut record = Vec::new();
let mut count = 0;
while let Some(result) = reader.next_record(&mut record).await {
count += 1;
std::hint::black_box(parse_record(result.unwrap(), &record).unwrap());
}
assert_eq!(count, N + 118);
});
});

group.bench_function("AsyncMessageStream_1M_zstd", |b| {
b.to_async(&rt).iter(|| async {
let mut reader = RecordReader::new(Cursor::new(&mcap_data_zstd));
let mut record = Vec::new();
let mut count = 0;
while let Some(result) = reader.next_record(&mut record).await {
count += 1;
std::hint::black_box(parse_record(result.unwrap(), &record).unwrap());
}
assert_eq!(count, N + 118);
});
});

group.bench_function("AsyncMessageStream_1M_lz4", |b| {
b.to_async(&rt).iter(|| async {
let mut reader = RecordReader::new(Cursor::new(&mcap_data_lz4));
let mut record = Vec::new();
let mut count = 0;
while let Some(result) = reader.next_record(&mut record).await {
count += 1;
std::hint::black_box(parse_record(result.unwrap(), &record).unwrap());
}
assert_eq!(count, N + 118);
});
});
}

group.finish();
}
Expand Down

0 comments on commit 1056c7c

Please sign in to comment.