MCPcopy Create free account
hub / github.com/csskit/csskit / parse_sheet

Function parse_sheet

crates/csskit_ast/benches/parse_sheet.rs:30–45  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

28}
29
30fn parse_sheet(c: &mut Criterion) {
31 let mut group = c.benchmark_group("parse_sheet");
32 for file in get_files() {
33 group.throughput(Throughput::Bytes(file.source_text.len() as u64));
34 group.bench_with_input(BenchmarkId::from_parameter(&file.name), &file.source_text, |b, source_text| {
35 b.iter_with_large_drop(|| {
36 let allocator = Bump::default();
37 let lexer = Lexer::new(&CsskitAtomSet::ATOMS, &source_text);
38 let _ = Parser::new(&allocator, source_text, lexer).parse_entirely::<Sheet>();
39
40 allocator
41 });
42 });
43 }
44 group.finish();
45}
46
47#[cfg(target_family = "unix")]
48criterion_group! {

Callers

nothing calls this directly

Calls 3

finishMethod · 0.80
get_filesFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected