mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-27 04:01:11 +08:00
perf: run 签名改 &Arc<CompiledModule>,顶层模块跨 run 共享——collect_flat_modules 顶层改 Arc::clone 消除逐 run 常量池深拷贝,全调用点 Arc 包装迁移
This commit is contained in:
@@ -9,7 +9,7 @@ fn bench_property(c: &mut Criterion) {
|
||||
let js = "var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 }; var sum = 0; for (var i = 0; i < 10000; i++) { sum += obj.a + obj.b + obj.c + obj.d + obj.e; } sum";
|
||||
let alloc = oxide_parser::Allocator::default();
|
||||
let program = oxide_parser::parse(&alloc, js).expect("parse");
|
||||
let module = Compiler::new().compile(&program).expect("compile");
|
||||
let module = Arc::new(Compiler::new().compile(&program).expect("compile"));
|
||||
|
||||
c.bench_function("property", |b| {
|
||||
b.iter_batched(
|
||||
|
||||
Reference in New Issue
Block a user