Repository navigation
perf: faster first frames, playback and loading, with less memory - #1
Merged
Merged
Conversation
A part rastered frame by frame is made less often where its rasters take long, each held a few frames; the playback's end then showed a frame held from before it. The end is now drawn at its own frame (the held-rasters test failed on slow CI machines).
A shadow cast from past the view (seen through see-through content, or whose offset moves) is cast by its content moved past the view's left edge, on a canvas reaching over it. The canvas reached over the casters only, so their blur was cut where it ended: a straight edge in the shadow's halo. It now reaches as far as the blur does.
Groups moved by the groups they are in became layers only where the playback was short enough (10 s) for their matrix to be sampled at every frame; they now are up to 20 s. Moving canvases are sized to where they draw wherever their bounds (sampled 15 times a second) can be sampled throughout, not only within 10 s. Over the corpus, the operations drawn again each frame fall from 23,835 to 20,328 (welcome-star's 3,883 to 430).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A 50-iteration improvement loop on playback performance, memory and allocation cost, and time to first frame: 41 changes kept, 9 tried and reverted. Each experiment is recorded under
.agentx/experiments/2026-10-27-performance-improvements/.Results
vector-animation-check bench artifacts-temp/corpus(the 53 corpus files, release build, median of 3):frame_ata frame (sum)An app's imported compiled scene (
Source::Json) reads 30% faster: it is no longer written back to text and parsed again.What changed
frame_at: fill and stroke take the shape's path rather than copies, there is no merged copy of a single outline, and rectangles, ellipses and stars allocate their outlines once.compiled::from_valueanddxn_vector_animation_lottie::read_valueread JSON values directly.vector-animation-check bench <dir> [--runs n] [--files] [--values]with a counting allocator.For review
main.main.DXN_CORPUS) gives the same per-file results.draw_pixmapover all 8.4 million (channel, alpha, destination) combinations, at four opacities.Limits::max_bytes, since the value is already in memory. Node, keyframe, depth and point limits still apply throughScene::checkand the converters.repeating_tracks,sampled_values,constant_tracks,canvas_saves,still_translations,still_partsandjson_valuesin the player, plus new tests incss_selectorsandcompiled_checks.AGENTS.md's commands pass: fmt, clippy for the core and the player,cargo test --all-features, the player's tests, and the wasm check.