microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
compiler/qsc/benches/library.rs
20lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | allocator::assign_global!(); |
| 5 | |
| 6 | use criterion::{criterion_group, criterion_main, Criterion}; |
| 7 | use qsc::{compile, TargetCapabilityFlags}; |
| 8 | use qsc_frontend::compile::PackageStore; |
| 9 | |
| 10 | pub fn library(c: &mut Criterion) { |
| 11 | c.bench_function("Core + Standard library compilation", |b| { |
| 12 | b.iter(|| { |
| 13 | let store = PackageStore::new(compile::core()); |
| 14 | compile::std(&store, TargetCapabilityFlags::all()) |
| 15 | }); |
| 16 | }); |
| 17 | } |
| 18 | |
| 19 | criterion_group!(benches, library); |
| 20 | criterion_main!(benches); |
| 21 | |