IDEA stops parsing when losing focus

It seems like IDEA stops parsing the current file when it loses focus.
Is this intended?

I want to be able to go to a large file, put IDEA in the background,
read some mail or whatever, and come back when it has parsed the entire
file. As it works now I can't do anything but stare at the editor for a
minute or two until it has been parsed and highlighted.

12 comments

It seems like IDEA stops parsing the current file when it loses focus.


Yes, of course it's intentional. Would you like IDEA to prevent you from
doing anything on your computer by using 100% of CPU? Unfortunately time
sharing between processes is far from ideal on Windows :-(.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Jonas Kvarnström" <jonkv@ida.liu.se> wrote in message
news:3F96A860.4030801@ida.liu.se...

It seems like IDEA stops parsing the current file when it loses focus.
Is this intended?

>

I want to be able to go to a large file, put IDEA in the background,
read some mail or whatever, and come back when it has parsed the entire
file. As it works now I can't do anything but stare at the editor for a
minute or two until it has been parsed and highlighted.

>


0

Yes, I have similar observations.

0

Is it possible to make this option controllable?

0

Valentin Kipiatkov (JetBrains) wrote:

>>It seems like IDEA stops parsing the current file when it loses focus.


Yes, of course it's intentional. Would you like IDEA to prevent you from
doing anything on your computer by using 100% of CPU? Unfortunately time
sharing between processes is far from ideal on Windows :(.


That's not a problem, I always set IDEA to "below normal" priority since
Windows seems to have some problems timesharing Java processes.

Any chance of being able to configure this behaviour? I'd love to have
this feature even if it's just a temporary system property or something
like that which is active for a couple of months until you get the
chance to optimize the syntax highlighting system again. (I'll file an
SCR later...)

0

I won't mind if my CPU is 100% utilized, as long as the parsing thread is a low enough priority.

0

I won't mind if my CPU is 100% utilized, as long as the parsing thread is

a low enough priority.

From my experience setting thread priorities in Java does not have any
noticable effect at all. At least on Windows.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Rob Sigel" <a_ufie@yahoo.com> wrote in message
news:11012304.1066839057224.JavaMail.itn@is.intellij.net...

I won't mind if my CPU is 100% utilized, as long as the parsing thread is

a low enough priority.


0

Surely even if IDEA wanted 100% of the cpu it would still be timesliced
by the os to allow me to read my mail etc. as the vm is running at the
same priority as all my other apps. I can set my project compiling and
do other things so what's the difference with parsing?

N.

Valentin Kipiatkov (JetBrains) wrote:

>>It seems like IDEA stops parsing the current file when it loses focus.


Yes, of course it's intentional. Would you like IDEA to prevent you from
doing anything on your computer by using 100% of CPU? Unfortunately time
sharing between processes is far from ideal on Windows :-(.


0


"Valentin Kipiatkov (JetBrains)" <valentin@intellij.com> wrote in message
news:bn6a9g$ua2$1@is.intellij.net...

I won't mind if my CPU is 100% utilized, as long as the parsing thread

is

a low enough priority.

>

From my experience setting thread priorities in Java does not have any
noticable effect at all. At least on Windows.


100% utilization is not a problem, problem is detecting that a user wants to
do something else and to make system responsive to user's actions.

How about yielding control often enough to keep system responsive? yield()
was designed for systems for cooperative multitasking but it also helps to
increase responsivness on preemtive systems.

Or is your parsing process so monolithic that you cannot stop for a moment
to yield control? Somehow people lived for more than 10 years under Win16...

Michael J.


0


Valentin Kipiatkov (JetBrains) wrote:

It seems like IDEA stops parsing the current file when it loses focus.

>

Yes, of course it's intentional. Would you like IDEA to prevent you from
doing anything on your computer by using 100% of CPU? Unfortunately time
sharing between processes is far from ideal on Windows :(.


Well, I'd also like to see this as an option. Even if this means to lower the priority
of the whole IDEA process, doing something else while a file is being parsed would
be really nice.

A nice comprimise would be a switch in the status bar. With this you can quickly decide
to let IDEA running if you only want to surf the net or read some emails or if it should
stop when loosing focus for doing more CPU intensive stuff.

And you shouldn't forget those lucky ones with dual-processor machines... (Hmm, I am
not, I just got fooled by this HyperThreading crap, but that's another story)


Sascha


0

Michael Jouravlev wrote:

"Valentin Kipiatkov (JetBrains)" <valentin@intellij.com> wrote in message
news:bn6a9g$ua2$1@is.intellij.net...

>>>I won't mind if my CPU is 100% utilized, as long as the parsing thread


is

>>a low enough priority.
>>
>>From my experience setting thread priorities in Java does not have any
>>noticable effect at all. At least on Windows.


100% utilization is not a problem, problem is detecting that a user wants to
do something else and to make system responsive to user's actions.

How about yielding control often enough to keep system responsive? yield()
was designed for systems for cooperative multitasking but it also helps to
increase responsivness on preemtive systems.

Or is your parsing process so monolithic that you cannot stop for a moment
to yield control? Somehow people lived for more than 10 years under Win16...


At least on Win XP and 2000 systems, yield() has no appreciable affect. While
I have read the online docs, and it just does not operate as advertized.

What does work well as a replacement is Thread.sleep(1);. As soon as the
JVM calls this method, the OS will do a thread context switch, and work on
something else. The 1 millisecond wait time is short enough that we probably
won't have to wait too long before we gain control again.

0

Sergei S. Ivanov wrote:

Yes, I have similar observations.

Heh, this explains why when I threw idea in the background to do some
other work while it was parsing, walked away from my desk for 30
minutes, then came back, and saw idea was not done.

This is bad!

R

0

Jonas Kvarnström wrote:

It seems like IDEA stops parsing the current file when it loses focus.
Is this intended?


I've just submitted an SCR:
http://www.intellij.net/tracker/idea/viewSCR?publicId=19682. Feel free
to vote...

0

Please sign in to leave a comment.