Issue Details (XML | Word | Printable)

Key: NUCACCECLIPSE-8
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andy Jefferson
Reporter: Luis Cruz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Tools : Eclipse plugin

consolePatternMatchListeners use too much CPU and cause delays in the console

Created: 06/Nov/10 02:48 PM   Updated: 23/Nov/10 09:48 PM   Resolved: 18/Nov/10 09:50 AM
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: 2.0.4


 Description  « Hide
The plugin's consolePatternMatchListeners use too much CPU when an application that logs more than a few lines to the console is run in Eclipse. Just 150KB of logs are enough to keep the CPU at 100% for a while and cause a few secs delay in the console. This can probably be avoid by using a better qualifier than ".*".

Andy Jefferson added a comment - 06/Nov/10 09:46 PM
There is no reference to any "consolePatternMatchListeners" in any DN eclipse plugin code ... there is a JdoPatternMatcher fwiw. Perhaps you can define what you mean by suggesting a patch to improve the situation (that I don't see)

Luis Cruz added a comment - 07/Nov/10 01:48 AM
This is what I mean:

    <extension point="org.eclipse.ui.console.consolePatternMatchListeners">
        <consolePatternMatchListener class="org.datanucleus.ide.eclipse.console.EnhancedPatternMatcher"
            id="matchenhancer" qualifier=".*" regex=".*(ENHANCED|NOT ENHANCED|UNKNOWN|NOT ENHANCED).*">
            <enablement/>
        </consolePatternMatchListener>
        <consolePatternMatchListener class="org.datanucleus.ide.eclipse.console.JdoPatternMatcher"
            id="matchenhancer1" qualifier=".*" regex="&gt;&gt;.*">
            <enablement/>
        </consolePatternMatchListener>
    </extension>

The ".*" qualifier is making Eclipse to try to match both patterns to every console, even those for which is not needed. I temporary solved my problem by disabling the matchers (by setting the qualifiers to something that will never match). To be honest, this is the first time I have a look at console matchers, and I'm not completely sure of the aim of these matchers or how to discriminate to which consoles they should be applied, so I can't suggest proper qualifiers. I don't know, maybe you really want them to be applied to the program's execution's console, in which case it might be worth to improve the patterns?

I have reproduced the problem in both Eclipse IDE for Java Developers Helios and Eclipse SpringSource Tool Suite 2.5.0.RELEASE (both in Mac OS X). As soon as I install the Datanucleus plugin, each time I run a verbose program in Eclipse it starts using a lot of CPU for some time and, if the console's history isn't set to unlimited, big pauses each time the buffer gets full). After disabling the matchers the problem disappear.

Andy Jefferson added a comment - 18/Nov/10 09:50 AM
SVN trunk comments out the "ENHANCED" matcher which was written by someone a long time ago and didn't work anyway. The other matcher for lines starting ">>" is still enabled.

Andy Jefferson made changes - 18/Nov/10 09:50 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 2.0.4 [ 11081 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 23/Nov/10 09:48 PM
Status Resolved [ 5 ] Closed [ 6 ]