Multithreading for read only operations

From what I've noticed, on dual CPU machine, even when performing
read-only operations (search, inspection, class parsing) IDEA never uses
more than 50% CPU. My guess is that this is because the prosess is
executed in one thread. I think that it should be relatively easy to
paralelize at least the search operations (and possibly the local

Comment actions Permalink

Reminds me of a post on earlier this week. Multiprocessor (and multicore) machines will become more and more common in the coming years.

This is the kind of performance enhancement that very few applications cared to take care of, but will become increasingly important.

Now, I don't see myself using a multicore machine in the next couple of years. I wonder how many people out there are on the same boat as you.

Comment actions Permalink

Such timings as I've been able to do suggest that the bulk of the time in the local inspections is in loading the parse tree (which is probably going to be horrible to parallelize) and registering any resulting errors (which is probably going to be difficult to parallelize but not impossible). Actual traversal of the parse tree and detection of errors, which are coded as stateless actions and extremely parallelizable, are already a minority of the processing time. If an inspection requires resolution of references, that adds some time, but surprisingly little.

Note that these timings are pretty crude, and need to be redone with greater precision, but that's what I'm seeing.

--Dave Griffith

Comment actions Permalink

Over 2.5 years later this still appears to be the case - only one processor being used for computationally intensive tasks. And yes, a lot of us are using boxes with more than one processor.

So how about getting a bit more parallelism into the cpu intensive tasks! :)

Comment actions Permalink

My work started giving us multi-processor boxes 4 years ago. It's good to finally have an application to take advantage of it.

Comment actions Permalink

My work started giving us multi-processor boxes 4 years ago. It's
good to finally have an application to take advantage of it.

Out of curiosity, how much does it help for "Find Usages"?

Also, will calling result in a concurrent
execution of the query?


Comment actions Permalink

Find Usages appears to use only a single cpu on my dual core workstation.

But syntax/inspections parse and Analyse->Inspect Code are using both cpus.
Although, when I am running Analyze->Inspect Code across a module, the cpu
usage is fluctuating, it isn't using both cpus 100% all the time; I guess this
might have to do with how the work is divided up.

The biggest difference for me is that the syntax/inspections parse is happening
faster for files. Unfortunately, I don't have time to actually measure the
difference between IDEA 6.0 and 7.0, so all I can see is it feels faster. I don'
t know if it is close to 2X faster for dual-core, and possibly 4X for quad-core,
but I would really like to know! Would make justifying a new quad core
workstation much easier!

One thing that Eclipse does which is very commendable is that they publish
performance diffs between the EAP version and the last stable version. See for

This IDEA 7.0 release would be an opportune time for Jetbrains to do the same.
Let's see the improvement between IDEA 6.0 and IDEA 7.0 for time to startup,
time to loading a 5000 line java file and display the syntax/inspections, etc.

They could go a step further and show that the speedup gets better with a quad-
core versus dual-core versus single-core.

Comment actions Permalink

As usual I agree 100%.

In addition it would be nice if a search query through the API could be executed
concurrently, either explicitly or though heuristics.



Please sign in to leave a comment.