jEdit Community - Resources for users of the jEdit Text Editor
Console plugin significantly slows down build process
Submitted by shlomy on Sunday, 19 November, 2006 - 11:59
Hi,

I've started using the Console plugin (with the ErrorList plugin) to build our project. First, I must say that the Console plugin is really great - it is very easy to configure to support other tools (e.g. g++), and it simplies working with jEdit a lot.

The problem is that the output of my build process, which is quite large, is displayed in the Console plugin very slowly (much slower than the Linux shell), and this slows down the build significantly. Any idea why this happens or what I can do to fix this slowdown?

Also, from the documentation of the Console plugin, it seems like it tries to match all the Error Patterns until it finds a match. Is this the way it works? While it may be good enough for most purposes, there are several problems with this:
1. Lines which do not express errors in the output of one tool, may express errors in the output of another tool. So if I'm running the first tool, I may get false errors because its output is also matches with the other error patterns. (Probably rare, though)
2. The output is probably slowed down by several redundant pattern matches.

Since the Console plugin cannot really know which tool is generating the output, it can either try all of the Error Patterns or rely on the user to indicate which Error Patterns to include. When I run "make", I only have "g++" output, so I don't need to match all other patterns (I've added a 'g++' error pattern manually). When I run Perl, I only have Perl output. I can erase some error patterns to exclude them, but I think the Console plugin should enable the user to select the active error patterns to use (e.g. using check-boxes or using disable/enable buttons below the Error Patterns list), to avoid unwanted pattern matches.

Shlomy
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
errors
by Robert Schwenn on Mon, 20/11/2006 - 19:47
Hi,
I think, the way console searches for lines with errors, is just trying to match the output against every error pattern until there is found an error (in the order the patterns appear in the options pane).

And this may be a reason for slowdown processes running in console. You probably can test it by setting the property "console.errors.list=" to an empty string. (So it should be able to rollback this "deleting" of all error patterns by resetting this one property to the old value).

To avoid unwanted pattern matches:
May be it was a solution to define mode-dependent patterns and probably a global switch to decide whether to use only patterns of current mode or all patterns? So the user wouldn't have to say: "Now I will run tool 1, but now tool 2 and so on.

Robert
 
Continued...
by shlomy on Mon, 20/11/2006 - 20:11
How do I set the property "console.errors.list"? Do I just edit the jEdit configuration file? And will it not erase the existing error patterns so I will be able to cancel this change and use them again?

Regarding the unwanted pattern matches: The patterns are related to tools, not edit modes. They are produced from tools. I'd like to be able to specify one way or another which tools I'm going to from now until I change this specification again. The global switch should be something like a check-box near each tool (or error pattern, whatever you call it).
 
unwanted pattern matches
by Robert Schwenn on Tue, 21/11/2006 - 22:06
Sure, the patterns are related to tools. The idea was, that the tools often deal with the current buffer (resp. the matching file) an that's why the set of used tools is indirectly mode-dependend. It's like Yours - only a bit automatic.

B.T.W. I believe, that most developrs don't monitor the forums :-|
 
properties
by Robert Schwenn on Tue, 21/11/2006 - 21:18
jEdit core and every plugin come with a *.props file in it's jar, that predefines many (or all ?) poperties. Each predefined property will be overridden at startup by a property of same name in:
1. any *.props file in directory (jedit_home)\properties
2. the "properties" file in the user settings directory (highest priority).

When changing any option in an option pane, the matching property is written to the user's properties file (When this file is open in jedit it is updated rather at shutdown of jedit than just in time.)
So, when You add an error pattern for console, some lines are written to the properties file, that describe this pattern. And it's written an extra property "console.errors.list" that holds the whole list of error patterns.

Now I have to correct me (I just tested it): Setting this property to an empty string re-activates the default error list (property "console.errors.default" in console.props). So, if You want to deactivate both Your own and default error patterns, You can do it by adding the following lines to the properties file:
console.errors.default=
console.errors.list=
An existing property (i.e. Your changed list of error patterns) can be commented out by preceeding a "#".

If You want to re-activate the whole Patterns list, delete both empty properties and delete the "#" before Your last "console.errors.list".
 
Speed issue remains
by shlomy on Mon, 27/11/2006 - 12:24
It turns out that the slow Console output is not caused by the number of error patterns. For a short time, I did notice a major improvement after removing all the redundant error patterns, but now the Console output is again periodically slow, even though I'm using a single error pattern.
 
Console output parsing speed
by AlanEzust on Mon, 27/11/2006 - 20:50
The reason it is slower than it was in 4.2.6.4 and earlier versions is because the output is being processed character-by-character instead of being buffered (like it was before).

The character-by-character output processing is necessary to allow the running of interactive stdio based programs inside the console plugin.

Perhaps if there was an option to switch between the old buffering and the new character-based output parsing, that would make it possible for you to choose which one you want.
 
Reason for slow Console output
by shlomy on Tue, 02/01/2007 - 09:56
A friend of mine is working on fixing the "Stop" button so that it stops the entire process tree of the foreground process running in the Console on Windows. While at it, he found (by accident) the reason for the slow speed of the Console: it turns out that when jEdit has the focus, the Console is periodically slow, and this slows down the foreground task. When jEdit loses the focus (e.g. to another window or a screensaver, for example), the Console gets very fast. This might be related to the fact that the Swing text widget on which Console displays the output needs to show the caret while it has the focus, and does not need to show it when it's running in the background.
This effect is always reproducible in my friend's machine. Whenever he puts jEdit in the background, the Console becomes very fast (it doesn't have to be covered with other windows, it's enough that it's not in the foreground). Whenever he gives back the focus to jEdit, the Console becomes slow.
 
.. and another reason
by shlomy on Thu, 04/01/2007 - 07:01
I also noticed that when the console has a lot of text in it (output from various commands), appending new output is very slow. If I clear the console window, the output becomes fast again.
User login
Browse archives
« September 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   99925
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17480
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300