Bug 27951 - Removing search results could be improved
Summary: Removing search results could be improved
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-12-09 11:23 EST by John Arthorne CLA
Modified: 2002-12-13 05:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2002-12-09 11:23:51 EST
Build I20021204

There are significant performance problems with the "Remove All Matches" action
in the search results view when using a large workspace, or when there are many
search results.  First, this action executes without a busy cursor and thus can
lock the UI without any painting for several minutes.

I profiled this action, expecting that most of the time was taken by the core
removal operation.  In fact, most of the time is taken by the search results
view update code.  The entry point is SearchManger#handleSearchMarkersChanged. 
This code iterates over the markers one at a time, does a linear search for the
marker in the results data structures, and then does a removal with linear cost
if the marker is found.  It then removes the single entry (one at a time) from
the table viewer.  This could be significantly improved in the common case where
the user has selected to "remove all matches".  

Interestingly, there is a method SearchManager#handleRemoveAll which does this
in an optimal fashion, but it never seems to be called.
Comment 1 Dani Megert CLA 2002-12-09 11:42:25 EST
Needs investigation.

NOTE: Regarding busy cursor: there's a PR which hasn't been fixed for a while:
Bug 5544: [Viewers] Sometimes no busy cursor for action started from context menu
Comment 2 Dani Megert CLA 2002-12-13 05:54:24 EST
Search is marker driven. Even if the resource delta only contains remove marker
deltas then the SearchManager is not sure whether all markers got deleted.
However I can improve the performance by letting the SearchManager remove all
results and the action triggers that removeAll.