Skip to content

Commit

Permalink
Feat(kclvm-sema): Update outdated bench tests. (#234)
Browse files Browse the repository at this point in the history
Update outdated bench tests.

issue #191.
  • Loading branch information
zong-zhe committed Oct 10, 2022
1 parent a0b44e8 commit 1a5ddd7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kclvm/sema/benches/my_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use std::rc::Rc;

use criterion::{criterion_group, criterion_main, Criterion};
use kclvm_sema::ty::*;

pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("sup", |b| {
b.iter(|| {
let types = vec![
Type::int_lit(1),
Type::INT,
Type::union(&[Type::STR, Type::dict(Type::STR, Type::STR)]),
Type::dict(Type::ANY, Type::ANY),
Rc::new(Type::int_lit(1)),
Rc::new(Type::INT),
Rc::new(Type::union(&[
Rc::new(Type::STR),
Rc::new(Type::dict(Rc::new(Type::STR), Rc::new(Type::STR))),
])),
Rc::new(Type::dict(Rc::new(Type::ANY), Rc::new(Type::ANY))),
];
sup(&types);
})
Expand Down

0 comments on commit 1a5ddd7

Please sign in to comment.