diff --git a/rbx_binary/benches/suite/main.rs b/rbx_binary/benches/suite/main.rs index a1e88e0d..391c667d 100644 --- a/rbx_binary/benches/suite/main.rs +++ b/rbx_binary/benches/suite/main.rs @@ -1,34 +1,42 @@ mod util; use crate::util::bench; -use criterion::{criterion_group, criterion_main, Criterion, SamplingMode}; +use criterion::{criterion_group, criterion_main, Criterion, SamplingMode, Throughput}; pub fn folders_100(c: &mut Criterion) { + let bytes = include_bytes!("../files/folders-100.rbxm"); bench( - &mut c.benchmark_group("100 Folders"), - include_bytes!("../files/folders-100.rbxm"), + c.benchmark_group("100 Folders") + .throughput(Throughput::Bytes(bytes.len() as u64)), + bytes, ) } pub fn deep_folders_100(c: &mut Criterion) { + let bytes = include_bytes!("../files/deep-folders-100.rbxm"); bench( - &mut c.benchmark_group("100 Deep Folders"), - include_bytes!("../files/deep-folders-100.rbxm"), + c.benchmark_group("100 Deep Folders") + .throughput(Throughput::Bytes(bytes.len() as u64)), + bytes, ) } pub fn modulescripts_100_lines_100(c: &mut Criterion) { + let bytes = include_bytes!("../files/modulescripts-100-lines-100.rbxm"); bench( - &mut c.benchmark_group("100 100-line ModuleScripts"), - include_bytes!("../files/modulescripts-100-lines-100.rbxm"), + c.benchmark_group("100 100-line ModuleScripts") + .throughput(Throughput::Bytes(bytes.len() as u64)), + bytes, ) } pub fn parts_1000(c: &mut Criterion) { + let bytes = include_bytes!("../files/parts-1000.rbxm"); bench( c.benchmark_group("1,000 Parts") - .sampling_mode(SamplingMode::Flat), - include_bytes!("../files/parts-1000.rbxm"), + .sampling_mode(SamplingMode::Flat) + .throughput(Throughput::Bytes(bytes.len() as u64)), + bytes, ) }