From a8d18ac18a8177b971896be7c5c666a0e720f535 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 7 Dec 2009 21:48:31 -0500 Subject: [PATCH] Limit dash docs to 50 We has poor performance if we try to allocate hundreds of actors; a bit more ideally, we'd keep pulling as much as we can, but really no one should have more than 50 in the list as is now except on unreasonably large screen sizes. In the future we should change this to be pull-on-demand thing in a chunked fashion. https://bugzilla.gnome.org/show_bug.cgi?id=603522 --- js/ui/docDisplay.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/docDisplay.js b/js/ui/docDisplay.js index 6afcf4fa9..9ba6c4c65 100644 --- a/js/ui/docDisplay.js +++ b/js/ui/docDisplay.js @@ -16,6 +16,7 @@ const DND = imports.ui.dnd; const GenericDisplay = imports.ui.genericDisplay; const Main = imports.ui.main; +const MAX_DASH_DOCS = 50; const DASH_DOCS_ICON_SIZE = 16; const DEFAULT_SPACING = 4; @@ -453,7 +454,7 @@ DashDocDisplay.prototype = { // Should be kept alive by the _actorsByUri this.actor.remove_all(); let docs = this._docManager.getTimestampOrderedInfos(); - for (let i = 0; i < docs.length; i++) { + for (let i = 0; i < docs.length && i < MAX_DASH_DOCS; i++) { let doc = docs[i]; let display = this._actorsByUri[doc.uri]; if (display) {