mirror of
https://github.com/HigherOrderCO/Kind1.git
synced 2024-10-26 13:38:47 +03:00
chore: bench for gen-checker
This commit is contained in:
parent
4a94d211d4
commit
297752fb0a
@ -4,6 +4,7 @@
|
||||
|
||||
use self::tags::EvalTag;
|
||||
use self::tags::{operator_to_constructor, TermTag};
|
||||
|
||||
use hvm::syntax::Term;
|
||||
use kind_span::Range;
|
||||
use kind_tree::desugared::{self, Book, Expr};
|
||||
|
@ -175,3 +175,27 @@ fn bench_exp_pure_to_hvm(b: &mut Bencher) {
|
||||
}).fold(0, |n, _| n + 1)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[bench]
|
||||
fn bench_exp_pure_gen_checker(b: &mut Bencher) {
|
||||
|
||||
let paths = exp_paths();
|
||||
|
||||
let books: Vec<_> = paths.iter().map(|x| {
|
||||
let mut session = new_session();
|
||||
let mut book = resolution::parse_and_store_book(&mut session, &PathBuf::from(x)).unwrap();
|
||||
let result = resolution::check_unbound_top_level(&mut session, &mut book);
|
||||
let book = desugar::desugar_book(session.diagnostic_sender.clone(), &book).unwrap();
|
||||
assert!(result.is_ok());
|
||||
|
||||
(session, book)
|
||||
}).collect();
|
||||
|
||||
b.iter(move || {
|
||||
books.iter().map(move |(_, book)| {
|
||||
kind_checker::gen_checker(book, book.names.keys().cloned().collect())
|
||||
}).fold(0, |n, _| n + 1)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user