Repository navigation
perf: Hot reload no longer holds the Editor's main thread after a compile to capture sources or to list assemblies - #3293
Conversation
… PDB document table (#3275)
…that changed since the last compile (#3277)
… and pause-point tools are both disabled (#3276)
…e snapshot capture (#3280)
…n when it matches the compiled dlls (#3281)
… Manager for each assembly and source (#3282)
…s branch's tree The squash commit has the same tree as 974a2b5, which this branch already contains, so the merge records it without changing any file.
…compiled files instead of asking Unity on the main thread (#3283)
…freezes the Editor (#3285)
…thread after a domain reload (#3286)
… on the main thread after a domain reload (#3288)
… edited file has no method body (#3287)
…blies whose debug symbols a post-processor rewrote (#3291)
…list from waiting for the main thread (#3292)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This change moves hot-reload snapshot capture off the main thread and rebuilds the compilation list from saved data. Compile-status holds are capped at 30 seconds, and list-dependent warm-up work is skipped when no list is kept. The review found no concrete defect, so the change appears ready to merge. Security Architecture Review
Pre-merge checks |
|
Summary
uloop compilestill returns after the capture ends (chore: Prepare compile status and pause points for a background source snapshot capture #3280, perf: Hot reload's source snapshot capture no longer asks the Package Manager for each assembly and source #3282, perf: Hot reload's source snapshot capture lists assemblies from the compiled files instead of asking Unity on the main thread #3283, perf: Hot reload's source snapshot capture after a compile no longer freezes the Editor #3285). On the trial project (a large multi-assembly project), the main thread time went from 975 ms after a method-body edit and 1435 ms after a file add or remove (the first phase's medians) to 7 ms and 7 ms.Library/Bee, and fix: Hot reload no longer asks for a compile that cannot help when an edited file has no method body #3287 corrects the warning for such files, so these assemblies behave as on main (see Known limitations for whenLibrary/Beelacks that output). chore: Hot reload's startup log separates rebuilding the compilation list from waiting for the main thread #3292 splits the rebuild's logged time into work and the wait for the main thread.Merge status
perf/hot-reload-capture-off-main-thread. The integration branch already carries main's squash of the first phase (perf: Hot reload's source snapshot capture after a compile rewrites only the changed sources, and is skipped when hot reload and pause point are both disabled #3278).39aa56db(capture on a pool thread), onb7541193(plus the rebuilt list and the warm-ups), and on935ead91(this pull request's head), each withULOOP_DEBUGset and the Editor in the background.User Impact
get-compile-statusholds the compile's completion until the capture ends (at most 30 s), so commands sent afteruloop compilebehave as beforeCompilationPipeline.GetAssemblies()on the main thread, usually in the warm-uphot_reload_compilation_list_reconstructed(withreconstructMs,backgroundMs,mainThreadWaitMs),_saved,_save_skipped,_save_failed, and the capture breakdown's listing, PDB and compiler-PDB figures.docs/vibe-logs.mddescribes themChanges in behavior
Known limitations
reference_missing), its first hot reload asks Unity on the main thread, and that hot reload saves a new list. The domains after it rebuild the list again. The other reasons that come from an old saved list heal the same way.Library/Beeholds the compiler's output of the same build. Without it, an assembly whose PDB was rewritten has no snapshot of its files without a method body until its next compile, so an edit to only such a file is not picked up when--filesis omitted, and the rebuild refuses the list (pdb_documents_incomplete).Verification
935ead91(dispatched on the integration branch): Unity EditMode Tests (2022.3.62f3, 6000.3.15f1, 6000.5.8f1, latest 6000.7, and the Release code optimization leg) and Unity Compile Check (2022.3.62f1, 6000.5.4f1) passed.CompilationPipeline.GetAssemblies()in every field. They also compare the sources the capture lists with Unity's for every assembly:935ead91(body edit ×3, file add or remove ×3):--files.Closes #3222