Address Jim's notes

This commit is contained in:
Dzmitry Malyshau
2022-02-17 09:45:45 -05:00
parent 91990298b3
commit 8fd8e7d575
2 changed files with 8 additions and 5 deletions

View File

@@ -29,7 +29,7 @@ jobs:
# we could use `test` but `criterion` is a dev dependency,
# and it doesn't build with our MSRV
command: check
# `cli` already enables most features, so let's add the rest,
# `cli` already enables most features,
# except for `arbitrary`, which requires Rust-1.51
args: --workspace
- name: Check snapshots

View File

@@ -59,12 +59,15 @@ fn frontends(c: &mut Criterion) {
});
#[cfg(feature = "wgsl-in")]
group.bench_function("wgsl", |b| {
let inputs = gather_inputs("tests/in", "wgsl");
let inputs_wgsl = gather_inputs("tests/in", "wgsl");
let inputs = inputs_wgsl
.iter()
.map(|input| std::str::from_utf8(input).unwrap())
.collect::<Vec<_>>();
let mut parser = naga::front::wgsl::Parser::new();
b.iter(move || {
for input in inputs.iter() {
let string = std::str::from_utf8(input).unwrap();
parser.parse(string).unwrap();
for &input in inputs.iter() {
parser.parse(input).unwrap();
}
});
});