perf: reduce per-frame draw time spikes in toolbar and drawing layer#451
Open
Yoshihiko-Ino wants to merge 3 commits into
Open
perf: reduce per-frame draw time spikes in toolbar and drawing layer#451Yoshihiko-Ino wants to merge 3 commits into
Yoshihiko-Ino wants to merge 3 commits into
Conversation
Co-Authored-By: Yoshihiko-Ino <232758239+Yoshihiko-Ino@users.noreply.github.com>
…tion Co-Authored-By: Yoshihiko-Ino <232758239+Yoshihiko-Ino@users.noreply.github.com>
33652b0 to
8677c30
Compare
- CompassRenderer: cache icon textures to avoid per-frame GPU texture lookups; integrate upstream viewport size check and error logging - WorldMarkerNode: replace ToList().IndexOf() with direct dictionary traversal - WorldMarkerRenderer: reuse _idsToRemove list to reduce GC pressure - WorldMarkerRegistry: use TryGetValue to avoid KeyNotFoundException overhead - AuxBarNode: dirty flag to skip per-frame widget traversal when layout unchanged - WidgetPopup: fix duplicate PushStyleVar/PopStyleVar imbalance; improve error handling with finally-guarded ImGui.End(); fix _isCrashed reset on close - Umbra.Colors: use Stop()/Start() instead of Enabled toggle for thread-safe debounce timer reset - Umbra.DelvClipRects: clear _managedRects on disable to keep dictionaries in sync - Umbra.Drawing: case-insensitive resource name lookup in DocumentFrom() - VariablesEditorWindow: fix ValueChanged handler to update node.Value not variable.Value - WindowManager: lock _instances when removing closed window to prevent races
8677c30 to
2f8205b
Compare
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.
Summary
AuxBarManager: Replaced per-frame LINQ +ToList()inVisibleAuxBarPanelswith a pre-allocated list that is cleared and reused each frame.Toolbar: Added_cachedIsCursorNearfield soIsCursorNearToolbar()is called exactly once per frame instead of multiple times acrossUpdateToolbarNodeClassList(),UpdateToolbarAutoHideOffset(), andToolbar.Nodes.cs.Toolbar.Autohide: CachedImGui.GetIO()to a local variable to avoid multiple P/Invoke calls per frame; inlined theIsMultiMonitorSupportEnabled()helper.Toolbar.Nodes: CachedImGui.GetMainViewport()to a local variable insideRenderAuxBarNodes(); removed the redundantauxBarNode.ComputeBoundingSize()call (bounds are already computed insideRender()); removed two unusedusingdirectives; expandedToolbarXPosition/ToolbarYPositionto block-body properties so the viewport is fetched once per call.ToolbarWidget/WidgetManager: CachedImGui.GetIO()to a local variable where it was called multiple times in the same scope; replacedGetInvocationList()unsubscribe loops with direct= nullassignments.UmbraVisibility: Introduced a frame-scoped validity flag (_visibilityCacheValid) reset via[OnDraw(executionOrder: int.MinValue)];IsToolbarVisible()andAreMarkersVisible()now call the underlying checks at most once per frame and return cached results on subsequent calls.WindowManager: ReplacedGetInvocationList()unsubscribe loops with direct= nullassignments; moved window iteration outside the lock to reduce contention.Related
This PR covers only changes to the Umbra layer. Companion optimizations in the
Una.Drawinglibrary are submitted separately in una-xiv/drawing#25.