Skip to content

A render starts 5 to 12 times sooner in a real project - #147

Closed
shinyobjectz wants to merge 3 commits into
mainfrom
render-start
Closed

shinyobjectz wants to merge 3 commits into
mainfrom
render-start

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

Before a render drew its first frame, raea read or stat'ed every file under the edit's folder, twice over. In a real project that was most of a short render's time.

What it was doing

  • The export cache's key asked every media file under the folder whether it has an optimized copy: for each picture, sound and video it read the file's first and last MiB to fingerprint it and listed the copies' folder again (492 files in one project, 2,417 in another). Only a video has such copies, and where the copies' folder is empty no file has one. It also resolved every file's real path to see whether it is an earlier output.
  • The bundler's search for imports from outside the folder walked the whole folder with nothing left out: a project's .git, node_modules, renders and media, asking each entry what it is, whether or not the bundle was cached.

What changes

  • The copies' folder is listed once; only videos are fingerprinted, and only when there are copies. Only files that share a name with an earlier output (or are links) are resolved. The key is the same as before for the same files, so existing cached exports still hit.
  • The source walk leaves out what copy_dir never copies (hidden folders, node_modules, target) and reads an entry's kind from the directory listing.
  • Two start-up marks for RAEA_STARTUP_TRACE: "the composition bundled" and "the export cache looked up".

Measured

Time from spawn to the first frame of an .mp4 render, bundle cache warm, on two real projects:

project files before after
a 33-shot film, one shot 1,234 2.0 s 0.35 s
a film in chunks, one chunk 10,226 7.4 s 0.62 s

A 60-frame 1080p shot of the first: 4.7 s to 3.0 s end to end. Stills drawn by playing (raea play --offscreen --seek) on the same projects, warm: 0.5 to 1.2 s; one that took 4.05 s as a one-frame render is 0.63 s.

Checked

  • cargo test -p raea-runtime-bundle: the existing tests (an edited svg or jpeg changes the export key; a range copy is made, reused and keyed) and a new one (an edit's sources leave out hidden folders and packages).
  • tools/agents/check --land --lane render-start: L1 ok.

@shinyobjectz

Copy link
Copy Markdown
Owner Author

Landed on main through the lane: 4bc503d, 9a289e0, b776edd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant