You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: compile_project_incremental deep-clones CompiledSimulation out of the Arc on every call #643
After the assembly-memoization change, assemble_simulation returns Arc<CompiledSimulation> (a salsa-tracked memo). But compile_project_incremental (src/simlin-engine/src/db.rs) does (*arc).clone() to return an owned CompiledSimulation, preserving its public signature.
The big win lands: a no-op recompile correctly skips assembly (the memo is reused). But the call still deep-clones the entire CompiledSimulation -- the modules / offsets / cached_constant_info maps -- on every call, even when nothing changed.
Why it matters
The deep clone is pure overhead on the hot recompile path. Returning Arc<CompiledSimulation> to callers would drop even that clone. The downstream callers (libsimlin / pysimlin / cli) construct Vm::new by value, so threading the Arc through (or having Vm::new accept &CompiledSimulation / Arc<CompiledSimulation>) would eliminate the clone end-to-end.
Not a correctness issue
This is a performance follow-up only -- results are unaffected.
Identified during the salsa-pipeline-cleanup refactor (the assembly-memoization change that introduced Arc<CompiledSimulation> from assemble_simulation).
Activity