Bug 408745 - Download Manager clobbers the UI thread and is slow to respond when updating its list. r=sdwilsh, a1.9=mconnor
authoredward.lee@engineering.uiuc.edu
Fri, 21 Dec 2007 19:45:54 -0800
changeset 9623 e2dbec3271aa6ec7274b57ed8ef6c78bf086ecdd
parent 9622 9f0c6a4bfa7e5370b16781ba387f19c6a3f83713
child 9624 22d6c7b3913d2da352f1618f0eb877eea33781a5
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssdwilsh
bugs408745
milestone1.9b3pre
Bug 408745 - Download Manager clobbers the UI thread and is slow to respond when updating its list. r=sdwilsh, a1.9=mconnor
toolkit/mozapps/downloads/content/downloads.js
--- a/toolkit/mozapps/downloads/content/downloads.js
+++ b/toolkit/mozapps/downloads/content/downloads.js
@@ -62,18 +62,18 @@ let gDownloadListener = null;
 let gDownloadsView = null;
 let gSearchBox = null;
 let gSearchTerms = "";
 let gBuilder = 0;
 
 // Control the performance of the incremental list building by setting how many
 // milliseconds to wait before building more of the list and how many items to
 // add between each delay.
-const gListBuildDelay = 100;
-const gListBuildChunk = 10;
+const gListBuildDelay = 300;
+const gListBuildChunk = 3;
 
 // If the user has interacted with the window in a significant way, we should
 // not auto-close the window. Tough UI decisions about what is "significant."
 var gUserInteracted = false;
 
 // These strings will be converted to the corresponding ones from the string
 // bundle on startup.
 let gStr = {
@@ -1183,17 +1183,17 @@ function stepListBuilder(aNumItems) {
   }
 
   // Add another item to the list if we should; otherwise, let the UI update
   // and continue later
   if (aNumItems > 1) {
     stepListBuilder(aNumItems - 1);
   } else {
     // Use a shorter delay for earlier downloads to display them faster
-    let delay = Math.min(gDownloadsView.itemCount, gListBuildDelay);
+    let delay = Math.min(gDownloadsView.itemCount * 10, gListBuildDelay);
     gBuilder = setTimeout(stepListBuilder, delay, gListBuildChunk);
   }
 }
 
 /**
  * Add a download to the front of the download list
  *
  * @param aDownload