Repository navigation
Conversation
Extract the expression-only performance pipeline from storytold#856, preserve native impurity tracking, and retain graph-sized memo working sets with full estimated storage accounting. Validated native all-target strict Clippy, focused WASM check, formatting and diff checks. Behavioral regression tests compiled but not executed under daytime policy. Earlier local evaluator performance/checksum measurements are documented with provenance.
|
Hi @eliasx45, thanks for this PR! When you rebase, please also make sure it fits the other recent changes:
CI ( |
|
Hi @eliasx45, a real-world case for this PR. An After Effects project using Karton (a text box rig): 23 boxes, about 370 expressions. Each box path is a 20 KB expression that calls
Both causes are what this PR fixes. Nothing is reused between evaluations, and a shape layer's Once it's rebased I'll run it against that comp and post before and after numbers. If you're short on time, I can do the rebase onto the #2491 layout as a PR against your branch, keeping your commits. |
Expressions that repeatedly read other properties rerun scripts and rebuild host data unnecessarily. This PR extracts the expression-performance work from #856 into an independent change against current main, then extends its bounded result memo to retain graph-sized working sets. This PR has no media/audio, GPU residency, UI, dependency or manifest changes.
What changes
Math.randomandDate, including computed access, aliases and prototype access; existing cycle/time limits remain.sourceRectAtTimebounds without rasterizing, using the same buffer-extent calculation as rendering.Measurements and limits
The cache-capacity follow-up was measured on a local development integration, not rerun on this upstream adaptation. For repeated sweeps of 20 expression properties (28,800 evaluations), the standalone probe improved from 300.97 → 21.02 ms p50 and 321.80 → 26.66 ms p95. Numeric checksums matched at 1/4/8/20/50 properties. Peak diagnostic-process RSS rose from 27.36 → 57.58 MiB. The 50-property working set still exceeds the cache and still executes every script.
These are CPU evaluator measurements, not input-to-visible-frame latency or a whole-PR speedup claim. The budget estimates retained memo storage, not allocator RSS or total app RAM, and is per thread. Methodology and the full table: docs/expression-cache-performance.md.
Validation
cargo clippy -p effectcraft-expr -p effectcraft-render --all-targets -- -D warnings.cargo check -p effectcraft-expr -p effectcraft-render --target wasm32-unknown-unknown.rustfmt --checkon all changed Rust files andgit diff --check.This is the expression-only alternative to the broader held #856, including its expression prerequisites so it can be reviewed and merged independently.
Review follow-up
Integrated current upstream main and fixed clock access through property descriptors, including
Object.getOwnPropertyDescriptor(Date, "now").value(). The captured native clock function is wrapped before exposure so aliases and descriptors cannot bypass impurity tracking. Added a deterministic script-run-count regression.Final-tree formatting and strict workspace/all-target release Clippy passed. Exact old/fixed clock-wrapper probes reproduced the bypass and verified the fix in Node and Boa. Full behavioral tests and fresh performance benchmarks were not run for this update.