Bug 408745 - Download Manager clobbers the UI thread and is slow to respond when updating its list. r=sdwilsh, a1.9=mconnor
--- 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