Skip to content

#3729 Reduce inventory memory overhead#5867

Open
akleshchev wants to merge 3 commits into
developfrom
andreyk/viewer_3729
Open

#3729 Reduce inventory memory overhead#5867
akleshchev wants to merge 3 commits into
developfrom
andreyk/viewer_3729

Conversation

@akleshchev
Copy link
Copy Markdown
Contributor

UI elements already cache display name, getDisplayName() calls are rare and only come with other calls.

For items, any UI calls already engage internal getItem optimizations, so doing getItem in getDisplayName() has negligible performance overhead while avoiding storing a dupplicate of item's name. This also cuts performance overhead from allocations, so it's a net benefit performance wise on first load.

System folders do utilize display names that are different from default names, but they are not panel specific, they are global localizations. Store those in the model, not in the bridge.

Usage example: LLFolderViewItem::postBuild() already calls getName after getDisplayName(), so getItem will utilize mLastItem either way and the only refresh needed happens if user renames the item. Without the user the update happens only once.

Copy link
Copy Markdown
Contributor

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 aims to reduce inventory UI memory overhead by removing per-bridge cached display-name storage and moving system-folder display-name localization/caching into the inventory model (LLViewerInventoryCategory), while keeping a cached uppercase “searchable name” for filtering/sorting.

Changes:

  • Added on-demand, cached LLViewerInventoryCategory::getDisplayName() and display-name construction for protected/library folders.
  • Renamed bridge cache invalidation/build hooks from “display name” to “searchable name” and updated LLInventoryPanel refresh paths accordingly.
  • Updated LLInvFVBridge::getDisplayName() to fetch names directly from the inventory model (category display name or item name).

Reviewed changes

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

Show a summary per file
File Description
indra/newview/llviewerinventory.h Adds display-name caching API/state to LLViewerInventoryCategory.
indra/newview/llviewerinventory.cpp Implements category display-name generation for protected/library folders.
indra/newview/llinventorypanel.cpp Switches relabel/refresh invalidation to clear the searchable-name cache.
indra/newview/llinventorybridge.h Removes bridge mDisplayName storage and renames cache build/clear hooks to searchable-name.
indra/newview/llinventorybridge.cpp Updates bridge display-name lookup to consult the model; refactors item searchable-name building and related suffix logic.

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

Comment thread indra/newview/llviewerinventory.h Outdated
Comment thread indra/newview/llviewerinventory.h Outdated
Comment thread indra/newview/llviewerinventory.h Outdated
Comment thread indra/newview/llviewerinventory.cpp Outdated
Comment thread indra/newview/llinventorypanel.cpp Outdated
Comment thread indra/newview/llinventorybridge.cpp Outdated
Comment thread indra/newview/llinventorybridge.cpp
@akleshchev akleshchev force-pushed the andreyk/viewer_3729 branch 2 times, most recently from 032c8bd to a8eaace Compare May 25, 2026 22:15
@akleshchev akleshchev requested a review from Copilot May 25, 2026 22:16
Copy link
Copy Markdown
Contributor

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

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

Comment thread indra/newview/llviewerinventory.h Outdated
Comment thread indra/newview/llinventorybridge.cpp
Comment thread indra/newview/llinventorybridge.cpp Outdated
@akleshchev akleshchev changed the title #3729 reduce inventory memory overhead #3729 Reduce inventory memory overhead May 26, 2026
@akleshchev akleshchev force-pushed the andreyk/viewer_3729 branch from a8eaace to 53e02ca Compare May 26, 2026 17:54
@github-actions github-actions Bot added the llui label May 26, 2026
@akleshchev akleshchev force-pushed the andreyk/viewer_3729 branch 5 times, most recently from 17a7b66 to a079db8 Compare May 26, 2026 19:15
@akleshchev akleshchev requested a review from Copilot May 26, 2026 19:35
Copy link
Copy Markdown
Contributor

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

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

Comment thread indra/llui/llfolderviewitem.cpp Outdated
Comment thread indra/llui/llfolderviewitem.cpp Outdated
Comment thread indra/newview/llviewerinventory.h Outdated
Comment thread indra/newview/llinventorybridge.cpp Outdated
UI elements already cache display name, getDisplayName() calls are rare
and only come with other calls.

For items, any UI calls already engage internal getItem optimizations,
so doing getItem in getDisplayName() has negligible performance overhead
while avoiding storing a dupplicate of item's name. This also cuts
performance overhead from allocations, so it's a net benefit performance
wise on first load.

System folders do utilize display names that are different from default
names, but they are not panel specific, they are global localizations.
Store those in the model, not in the bridge.

Usage example: LLFolderViewItem::postBuild() already calls getName after
getDisplayName(), so getItem will utilize mLastItem either way and the
only refresh needed happens if user renames the item. Without the user
the update happens only once.
Tooltips are just names, there is no point buffering them.
@akleshchev akleshchev force-pushed the andreyk/viewer_3729 branch from a079db8 to f6d48ed Compare May 26, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants