From e5a30119a05e245ff948c32c6a53e1ee4a1411f9 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Mon, 12 Jan 2009 19:42:41 +0000 Subject: [PATCH] * There was a bug in the way the mimetypes list was constructed, it would recalculate the list on each addition, which is o(n). It's already refreshed lazily on read, only rarely when ContainerWindow updates his menu. Now there's only one recalc when finished adding poses, 9ms for 20K files here. Pose adding is almost linear now for the first thousand files, but it gets worse after that due to another known problem. Now doing 35s instead of 80s on a 20K files folder here, more to come :) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28891 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/PoseView.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 74532b64d7..05fbd18362 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -1626,7 +1626,6 @@ BPoseView::CreatePoses(Model **models, PoseInfo *poseInfoArray, int32 count, if (resultingPoses) resultingPoses[modelIndex] = pose; - AddMimeType(model->MimeType()); // set location from poseinfo if saved loc was for this dir if (poseInfo->fInitedDirectory != -1LL) { PinPointToValidRange(poseInfo->fLocation); @@ -1800,9 +1799,6 @@ BPoseView::CountMimeTypes() void BPoseView::AddMimeType(const char *mimeType) { - if (fMimeTypeListIsDirty) - RefreshMimeTypeList(); - int32 count = fMimeTypeList->CountItems(); for (int32 index = 0; index < count; index++) { if (*fMimeTypeList->ItemAt(index) == mimeType)