diff --git a/kclvm/sema/benches/my_benchmark.rs b/kclvm/sema/benches/my_benchmark.rs index 5b0bc6fbf..aad5d526e 100644 --- a/kclvm/sema/benches/my_benchmark.rs +++ b/kclvm/sema/benches/my_benchmark.rs @@ -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); })