aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Hanke <nils.hanke@outlook.de>2022-04-29 13:58:22 -0700
committerRoland Knall <rknall@gmail.com>2022-10-31 16:50:11 +0000
commit34a66401e8e61a0b1b6d2d1fae39408f563a45f0 (patch)
treebe08c912fd149eb7b0603731df9fd7ad85b410fd
parentfe4b0639541243a6d5664c36ff85813106d1d04a (diff)
UI: Only sort visible packets instead of all packets
Previously, Wireshark was sorting all packets in a capture, regardless whether they were actually visible or not. If you are working with large PCAPs & filters, this is a MASSIVE performance drag. Therefore, this commit changes this by only sorting the visible packets which boosts the sorting performance in filtered views massively.
-rw-r--r--ui/qt/models/packet_list_model.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp
index 659f01144d..9bac4dca5d 100644
--- a/ui/qt/models/packet_list_model.cpp
+++ b/ui/qt/models/packet_list_model.cpp
@@ -366,12 +366,13 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
busy_timer_.start();
sort_column_is_numeric_ = isNumericColumn(sort_column_);
- std::sort(physical_rows_.begin(), physical_rows_.end(), recordLessThan);
+ QVector<PacketListRecord *> sorted_visible_rows_ = visible_rows_;
+ std::sort(sorted_visible_rows_.begin(), sorted_visible_rows_.end(), recordLessThan);
beginResetModel();
visible_rows_.resize(0);
number_to_row_.fill(0);
- foreach (PacketListRecord *record, physical_rows_) {
+ foreach (PacketListRecord *record, sorted_visible_rows_) {
frame_data *fdata = record->frameData();
if (fdata->passed_dfilter || fdata->ref_time) {