Skip to content

Commit

Permalink
Measure throughput too
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethloeffler committed Oct 31, 2024
1 parent ad568ef commit ddc847a
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions rbx_binary/benches/suite/main.rs
Original file line number Diff line number Diff line change
@@ -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,
)
}

Expand Down

0 comments on commit ddc847a

Please sign in to comment.