Bug 49599 - Occurrences finder should use a job
Summary: Occurrences finder should use a job
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2004-01-06 15:53 EST by John Arthorne CLA
Modified: 2004-01-07 12:19 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 2004-01-06 15:53:07 EST
Build: 3.0 M6

I noticed that the background task to find occurrences in the file creates a new
thread every time, rather than using jobs.  This is exactly the situation that
jobs were created for (in fact Erich used this as a demo of the job
infrastructure at a code camp).  Some advantages of changing to jobs:

- less overhead (currently a new thread is created per key press, jobs use a
thread pool)
- better handling of priority (currently running in a thread with same priority
as the UI, and thus is competing with UI thread for CPU more than it should)
- smarter scheduling. Jobs with "DECORATE" priority are run based on a check of
how busy the system is.  Thus they do not run immediately if there are other
things going on (they will run eventually, just not as quickly). This smooths
over bottlenecks when the system is busy.

Note that you can prevent this job from showing in the progress view or making
the progress animation (cigarette) move by making it a system job
(Job.setSystem(true)).  Generally jobs that the user didn't explicitly start can
be marked as system jobs.

If there was a reason why jobs were considered and rejected, I'd be curious to
know.  If the infrastructure isn't useful to you then I want to fix it.
Comment 1 Dani Megert CLA 2004-01-07 03:10:20 EST
This needs to be consolidated together with the current ongoing work to have
only one AST built on post selection change. Currently there's no shared AST and
ever "client" needs to compute his own (e.g. occurrences finder, quick fix, ...)
Comment 2 Dani Megert CLA 2004-01-07 12:19:23 EST
Fixed.
Available in builds > 20040107