Skip to content

Commit

Permalink
[enhancement] cut 60% time for PerfParser::filterResults
Browse files Browse the repository at this point in the history
When change to "aggregate cost by symbol", filterResults spends a lot
of time doing string comparison. This patch will reduce it dramatically.

Test on a 240MB perf.data/6 core CPU. The time is reduced from 50.x seconds
to 19.x seconds.

Signed-off-by: Jason L <5919474+MuchToMyDelight@users.noreply.github.com>
  • Loading branch information
MuchToMyDelight committed Dec 19, 2023
1 parent 6899421 commit 9262fee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ QDebug operator<<(QDebug stream, const Symbol& symbol);

inline bool operator==(const Symbol& lhs, const Symbol& rhs)
{
return std::tie(lhs.symbol, lhs.binary, lhs.path, lhs.relAddr)
== std::tie(rhs.symbol, rhs.binary, rhs.path, rhs.relAddr);
return std::tie(lhs.relAddr, lhs.symbol, lhs.binary, lhs.path)
== std::tie(rhs.relAddr, rhs.symbol, rhs.binary, rhs.path);
}

inline bool operator!=(const Symbol& lhs, const Symbol& rhs)
Expand Down

0 comments on commit 9262fee

Please sign in to comment.