Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract storage #87

Draft
wants to merge 11 commits into
base: bbqueue-ng
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bbqtest/src/benches.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bbqueue::BBBuffer;
use bbqueue::BBQueue;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use std::cmp::min;

Expand All @@ -17,7 +17,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {

c.bench_function("bbq 2048/4096", |bench| bench.iter(|| chunky(&data, 2048)));

let buffy: BBBuffer<U65536> = BBBuffer::new();
let buffy: BBQueue<U65536> = BBQueue::new();
let (mut prod, mut cons) = buffy.try_split().unwrap();

c.bench_function("bbq 8192/65536", |bench| {
Expand Down Expand Up @@ -196,7 +196,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {

use crossbeam_utils::thread;
fn chunky(data: &[u8], chunksz: usize) {
let buffy: BBBuffer<U4096> = BBBuffer::new();
let buffy: BBQueue<U4096> = BBQueue::new();
let (mut prod, mut cons) = buffy.try_split().unwrap();

thread::scope(|sc| {
Expand Down
12 changes: 6 additions & 6 deletions bbqtest/src/framed.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[cfg(test)]
mod tests {
use bbqueue::BBBuffer;
use bbqueue::BBQueue;

#[test]
fn frame_wrong_size() {
let bb: BBBuffer<256> = BBBuffer::new();
let bb: BBQueue<256> = BBQueue::new();
let (mut prod, mut cons) = bb.try_split_framed().unwrap();

// Create largeish grants
Expand All @@ -25,7 +25,7 @@ mod tests {

#[test]
fn full_size() {
let bb: BBBuffer<256> = BBBuffer::new();
let bb: BBQueue<256> = BBQueue::new();
let (mut prod, mut cons) = bb.try_split_framed().unwrap();
let mut ctr = 0;

Expand Down Expand Up @@ -66,7 +66,7 @@ mod tests {

#[test]
fn frame_overcommit() {
let bb: BBBuffer<256> = BBBuffer::new();
let bb: BBQueue<256> = BBQueue::new();
let (mut prod, mut cons) = bb.try_split_framed().unwrap();

// Create largeish grants
Expand All @@ -93,7 +93,7 @@ mod tests {

#[test]
fn frame_undercommit() {
let bb: BBBuffer<512> = BBBuffer::new();
let bb: BBQueue<512> = BBQueue::new();
let (mut prod, mut cons) = bb.try_split_framed().unwrap();

for _ in 0..100_000 {
Expand Down Expand Up @@ -132,7 +132,7 @@ mod tests {

#[test]
fn frame_auto_commit_release() {
let bb: BBBuffer<256> = BBBuffer::new();
let bb: BBQueue<256> = BBQueue::new();
let (mut prod, mut cons) = bb.try_split_framed().unwrap();

for _ in 0..100 {
Expand Down
Loading