perf: run 签名改 &Arc<CompiledModule>,顶层模块跨 run 共享——collect_flat_modules 顶层改 Arc::clone 消除逐 run 常量池深拷贝,全调用点 Arc 包装迁移

This commit is contained in:
2026-09-11 22:19:13 +00:00
parent 542236a15a
commit 3169e8f2f9
106 changed files with 391 additions and 189 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ fn bench_gc(c: &mut Criterion) {
let js = "var g = {}; for (var i = 0; i < 500; i++) { var obj = { x: i, y: i * 2 }; g[i] = obj; } g[\"x\"]";
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("gc_mark_sweep", |b| {
b.iter_batched(