commit f853d07f066b909c74dcb5dca0c0582ac63741d3 Author: Tomás Touceda chiiph@torproject.org Date: Mon Jun 25 20:08:20 2012 -0300
Improve network map router loading performance --- changes/bug6216 | 3 +++ src/vidalia/network/NetViewer.cpp | 6 ++++-- src/vidalia/network/RouterListWidget.cpp | 1 + 3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/changes/bug6216 b/changes/bug6216 new file mode 100644 index 0000000..9484f75 --- /dev/null +++ b/changes/bug6216 @@ -0,0 +1,3 @@ + Internal cleanups and improvements: + o Improve Network Map router loading performance by disabling sorting with + every addition. Resolves ticket 6216. diff --git a/src/vidalia/network/NetViewer.cpp b/src/vidalia/network/NetViewer.cpp index 12f2081..2747cd6 100644 --- a/src/vidalia/network/NetViewer.cpp +++ b/src/vidalia/network/NetViewer.cpp @@ -73,6 +73,7 @@ NetViewer::NetViewer(QWidget *parent) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); + ui.treeRouterList->setSortingEnabled(false);
ui.lblConsensus->setVisible(false); ui.lblOffline->setVisible(false); @@ -454,14 +455,14 @@ NetViewer::preLoadNetworkStatus() void NetViewer::loadNetworkStatus() { - int count = 0, thres = 10; + int count = 0, thres = 50; for(; _it != _routers.constEnd() and count < thres; ++_it, ++count) { addRouter((*_it)); QCoreApplication::processEvents(); }
if(_it != _routers.constEnd()) - QTimer::singleShot(10, this, SLOT(loadNetworkStatus())); + QTimer::singleShot(1, this, SLOT(loadNetworkStatus())); else { QString id = _torControl->getInfo("fingerprint").toString(); RouterListItem *item = ui.treeRouterList->findRouterById(id); @@ -470,6 +471,7 @@ NetViewer::loadNetworkStatus() ui.lblOffline->setVisible(false); }
+ ui.treeRouterList->setSortingEnabled(true); /* Load existing address mappings */ loadAddressMap(); /* Load Circuits and Streams information */ diff --git a/src/vidalia/network/RouterListWidget.cpp b/src/vidalia/network/RouterListWidget.cpp index eb0d74c..409c99e 100644 --- a/src/vidalia/network/RouterListWidget.cpp +++ b/src/vidalia/network/RouterListWidget.cpp @@ -40,6 +40,7 @@ RouterListWidget::RouterListWidget(QWidget *parent) << tr("Uptime"));
/* Sort by descending server bandwidth */ + setSortingEnabled(false); sortItems(StatusColumn, Qt::DescendingOrder);
/* Find out when the selected item has changed. */
tor-commits@lists.torproject.org