···11extern crate repo_stream;
22-use repo_stream::Driver;
22+use repo_stream::{Driver, Step};
33use std::path::{Path, PathBuf};
4455use criterion::{Criterion, criterion_group, criterion_main};
···3838 };
39394040 let mut n = 0;
4141- while let Some(pairs) = driver.next_chunk(256).await.unwrap() {
4141+ while let Step::Value(pairs) = driver.next_chunk(256).await.unwrap() {
4242 n += pairs.len();
4343 }
4444 n
+11-11
readme.md
···79798080current car processing times (records processed into their length usize, phil's dev machine):
81818282-- 450MiB CAR file (huge): `1.3s`
8282+- 450MiB CAR file (huge): `1.4s`
8383- 128MiB (huge): `350ms`
8484-- 5.0MiB: `6.8ms`
8585-- 279KiB: `160us`
8686-- 3.4KiB: `5.1us`
8787-- empty: `690ns`
8484+- 5.0MiB: `7.0ms`
8585+- 279KiB: `170us`
8686+- 3.4KiB: `5.3us`
8787+- empty: `720ns`
88888989it's a little faster with `mimalloc`
9090···9494static GLOBAL: MiMalloc = MiMalloc;
9595```
96969797-- 450MiB CAR file: `1.2s` (-8%)
9898-- 128MiB: `300ms` (-14%)
9999-- 5.0MiB: `6.0ms` (-11%)
100100-- 279KiB: `150us` (-7%)
101101-- 3.4KiB: `4.7us` (-8%)
102102-- empty: `670ns` (-4%)
9797+- 450MiB CAR file: `1.1s` (-15%)
9898+- 128MiB: `300ms` (-15%)
9999+- 5.0MiB: `5.5ms` (-21%)
100100+- 279KiB: `140us` (-17%)
101101+- 3.4KiB: `4.3us` (-18%)
102102+- empty: `610ns` (-16%)
103103104104processing CARs requires buffering blocks, so it can consume a lot of memory. repo-stream's in-memory driver has minimal memory overhead, but there are two ways to make it work with less mem (you can do either or both!)
105105