Skip to content

Commit

Permalink
[SEARCH_VIEW] Investigate high RAM consumption
Browse files Browse the repository at this point in the history
This patch introduces various optimizations of RAM consumption and,
consequently, CPU consumption.

All optimizations were proven to be functional with the Valgrind Massif
tool.

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
  • Loading branch information
Vladyslav Goncharuk committed Jun 13, 2024
1 parent e7aa167 commit f8769bc
Show file tree
Hide file tree
Showing 14 changed files with 598 additions and 459 deletions.
2 changes: 1 addition & 1 deletion dltmessageanalyzerplugin/src/common/BaseDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

bool QOptionalColor::operator== ( const QOptionalColor& rhs ) const
{
return color == rhs.color && isSet == rhs.isSet;
return color_code == rhs.color_code && isSet == rhs.isSet;
}
2 changes: 1 addition & 1 deletion dltmessageanalyzerplugin/src/common/BaseDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Q_DECLARE_METATYPE(tQStringPtrWrapper)
struct QOptionalColor
{
bool isSet = false;
QColor color;
QRgb color_code;
bool operator== ( const QOptionalColor& rhs ) const;
};
typedef QVector<QOptionalColor> QOptionalColorVec;
Expand Down
18 changes: 9 additions & 9 deletions dltmessageanalyzerplugin/src/common/CTreeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,18 +423,18 @@ CTreeItem::CTreeItem(CTreeItem *pParent,
const tHandleDuplicateFunc& handleDuplicateFunc,
const tFindItemFunc& findFunc)
:
mData(),
mHandleDuplicateFunc(handleDuplicateFunc),
mChildItems(),
mpParentItem(pParent),
mSortedChildren(),
mbFirstLevelSorted(true),
mbWholeSorted(true),
mSortingColumn(defaultSortingColumn),
mSortOrder(Qt::SortOrder::DescendingOrder),
mSortingFunction(sortingFunction),
mFindFunc(findFunc),
mpGuard(std::make_shared<int>(0))
mHandleDuplicateFunc(handleDuplicateFunc),
mData(),
mSortedChildren(),
mpGuard(std::make_shared<int>(0)),
mpParentItem(pParent),
mSortOrder(Qt::SortOrder::DescendingOrder),
mSortingColumn(defaultSortingColumn),
mbFirstLevelSorted(true),
mbWholeSorted(true)
{}

tTreeItemPtr CTreeItem::appendChild(const tDataItem& key, const tData& additionItems)
Expand Down
19 changes: 10 additions & 9 deletions dltmessageanalyzerplugin/src/common/CTreeItem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,20 @@ class CTreeItem
void setIdx(const int& val);

private:
tData mData;
tHandleDuplicateFunc mHandleDuplicateFunc;

tChildrenMap mChildItems;
tTreeItemPtr mpParentItem;
QVector<tTreeItemPtr> mSortedChildren;
bool mbFirstLevelSorted;
bool mbWholeSorted;
int mSortingColumn;
Qt::SortOrder mSortOrder;
tSortingFunction mSortingFunction;
tFindItemFunc mFindFunc;
int mIdx; // idx in parent's collection
tHandleDuplicateFunc mHandleDuplicateFunc;
tData mData;
QVector<tTreeItemPtr> mSortedChildren;
tGuarded mpGuard;
tTreeItemPtr mpParentItem;
Qt::SortOrder mSortOrder;
int mIdx; // idx in parent's collection
int mSortingColumn;
bool mbFirstLevelSorted;
bool mbWholeSorted;
};

#endif // CTreeItem_HPP
Loading

0 comments on commit f8769bc

Please sign in to comment.