Skip to content
Snippets Groups Projects
Commit fd7bfb03 authored by Richard Linden's avatar Richard Linden
Browse files

MAINT-1175 FIX Severe performance issues on 3.3.2 (258114) Release and 3.3.3...

MAINT-1175 FIX Severe performance issues on 3.3.2 (258114) Release and 3.3.3 (259197) Beta in "Add scroll list item"
removed linear scan for namelist items and used weak reference (LLHandle) instead
parent 55a7bdf8
No related branches found
No related tags found
No related merge requests found
...@@ -336,7 +336,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( ...@@ -336,7 +336,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
// ...schedule a callback // ...schedule a callback
LLAvatarNameCache::get(id, LLAvatarNameCache::get(id,
boost::bind(&LLNameListCtrl::onAvatarNameCache, boost::bind(&LLNameListCtrl::onAvatarNameCache,
this, _1, _2)); this, _1, _2, item->getHandle()));
} }
break; break;
} }
...@@ -392,7 +392,8 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) ...@@ -392,7 +392,8 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
} }
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name) const LLAvatarName& av_name,
LLHandle<LLNameListItem> item)
{ {
std::string name; std::string name;
if (mShortNames) if (mShortNames)
...@@ -400,17 +401,14 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, ...@@ -400,17 +401,14 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
else else
name = av_name.getCompleteName(); name = av_name.getCompleteName();
item_list::iterator iter; LLNameListItem* list_item = item.get();
for (iter = getItemList().begin(); iter != getItemList().end(); iter++) if (list_item && list_item->getUUID() == agent_id)
{ {
LLScrollListItem* item = *iter; LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
if (item->getUUID() == agent_id) if (cell)
{ {
LLScrollListCell* cell = item->getColumn(mNameColumnIndex); cell->setValue(name);
if (cell) setNeedsSort();
{
cell->setValue(name);
}
} }
} }
......
...@@ -33,6 +33,26 @@ ...@@ -33,6 +33,26 @@
class LLAvatarName; class LLAvatarName;
/**
* LLNameListCtrl item
*
* We don't use LLScrollListItem to be able to override getUUID(), which is needed
* because the name list item value is not simply an UUID but a map (uuid, is_group).
*/
class LLNameListItem : public LLScrollListItem, public LLHandleProvider<LLNameListItem>
{
public:
LLUUID getUUID() const { return getValue()["uuid"].asUUID(); }
protected:
friend class LLNameListCtrl;
LLNameListItem( const LLScrollListItem::Params& p )
: LLScrollListItem(p)
{
}
};
class LLNameListCtrl class LLNameListCtrl
: public LLScrollListCtrl, public LLInstanceTracker<LLNameListCtrl> : public LLScrollListCtrl, public LLInstanceTracker<LLNameListCtrl>
{ {
...@@ -115,7 +135,7 @@ class LLNameListCtrl ...@@ -115,7 +135,7 @@ class LLNameListCtrl
/*virtual*/ void mouseOverHighlightNthItem( S32 index ); /*virtual*/ void mouseOverHighlightNthItem( S32 index );
private: private:
void showInspector(const LLUUID& avatar_id, bool is_group); void showInspector(const LLUUID& avatar_id, bool is_group);
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, LLHandle<LLNameListItem> item);
private: private:
S32 mNameColumnIndex; S32 mNameColumnIndex;
...@@ -124,24 +144,5 @@ class LLNameListCtrl ...@@ -124,24 +144,5 @@ class LLNameListCtrl
bool mShortNames; // display name only, no SLID bool mShortNames; // display name only, no SLID
}; };
/**
* LLNameListCtrl item
*
* We don't use LLScrollListItem to be able to override getUUID(), which is needed
* because the name list item value is not simply an UUID but a map (uuid, is_group).
*/
class LLNameListItem : public LLScrollListItem
{
public:
LLUUID getUUID() const { return getValue()["uuid"].asUUID(); }
protected:
friend class LLNameListCtrl;
LLNameListItem( const LLScrollListItem::Params& p )
: LLScrollListItem(p)
{
}
};
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment