Skip to content

Conversation

@ManlyMarco
Copy link
Owner

No description provided.

@ManlyMarco ManlyMarco requested a review from Copilot November 2, 2025 01:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes IMGUI rendering performance by reducing GC allocations through pre-allocated layout option arrays and moving expensive filtering operations to the Update loop instead of OnGUI. The changes improve runtime performance without affecting functionality.

  • Pre-allocated GUILayoutOption arrays to avoid per-frame allocations in OnGUI
  • Moved Inspector entry filtering from OnGUI (DrawContentScrollView) to Update loop to reduce GC pressure
  • Added component GUIContent caching in ObjectTreeViewer to reduce allocations
  • Converted foreach loops to for loops in hot paths

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
RuntimeUnityEditor.Core/Windows/Taskbar.cs Introduced pre-allocated layout option arrays and moved title generation to Enabled property setter
RuntimeUnityEditor.Core/Windows/ObjectTree/RootGameObjectSearcher.cs Made search member blacklist static readonly and moved filtering logic before LINQ chains
RuntimeUnityEditor.Core/Windows/ObjectTree/ObjectTreeViewer.cs Added component name GUIContent caching and pre-allocated layout option arrays
RuntimeUnityEditor.Core/Windows/Inspector/VariableFieldDrawer.cs Applied EmptyLayoutOptions to various GUILayout calls
RuntimeUnityEditor.Core/Windows/Inspector/Inspector.cs Moved entry filtering from DrawContentScrollView to Update method, reducing OnGUI GC allocations
RuntimeUnityEditor.Core/Windows/Inspector/Inspector.InspectorTab.cs Removed unused imports
RuntimeUnityEditor.Core/Utils/IMGUIUtils.cs Added EmptyLayoutOptions and LayoutOptionsNoExpansion constants
RuntimeUnityEditor.Core/Utils/Abstractions/GUILayoutShim.cs Added XML documentation comments
RuntimeUnityEditor.Bepin5/PatchInspector/PatchInspector.cs Applied EmptyLayoutOptions to GUILayout calls
RuntimeUnityEditor.Bepin5/PatchInspector/ILViewerWindow.cs Applied EmptyLayoutOptions to GUILayout calls
RuntimeUnityEditor.Bepin5/LogViewer/LogViewerWindow.cs Applied EmptyLayoutOptions to GUILayout calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ManlyMarco and others added 5 commits November 2, 2025 02:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ManlyMarco ManlyMarco merged commit 43a29b8 into master Nov 2, 2025
@ManlyMarco ManlyMarco deleted the gc branch November 2, 2025 01:58
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.

2 participants