Community
Participate
Working Groups
Build Identifier: 20100617-1415 Enabling the option "Show whitespace character" makes the editor type slow on Linux. The editor is normal responsive if this option is off. Performance decreases even more when you make the visible part of the editor larger (resize eclipse or the editor pane). Typing outside php tags is normal, but within php-tags it can slow down to 1 char per second. Bug 320135 is a similar problem, but then specific to Mac. Reproducible: Always Steps to Reproduce: 1.Enable "Show whitespace character" 2.Type anywhere between php-tags in the php-editor.
what is your project size and your machine configuration? I think php tags mean <?php ?> right? I maximize the php editor,and type lots of charactors,and it sees normal,btw,my php project is very small!
php tags mean <?php ?> The project size is >1500 php files (and >400 js files). If I create a project with only 1 file, there is no notable speed loss. I have a Intel Core2Duo E8400 @3GHz, 2G RAM running Ubuntu 10.04. Should be fast enough I'd say.
Thanks for your information!I will check it later. BTW,did you check it with other editor,for example java project with lots of java files?
I haven't got a similar large Java project, but a smaller java project doesn't suffer the problem and non-php files in the large php project don't suffer either.
Whitespace painting does in no way depend on the size of a project. It simply depends on the file shown in the editor.
Hmm, I tested again the same file in small or large project, and indeed it does not matter. What matters is the amount of characters in display. So if you edit the same file on a position with a lot of blank lines it is faster than typing in a position with a lot of long lines. (I think this is why I had different results in a smaller project: I typed on a different position)
But I have tested for lots of characters in display.Because you already said that in description.
Note: the 'very slow' can be changed to 'relatively slow'. On my PC the performance deterioration was doubled by some bad video settings (I used Xinerama to rotate 1 monitor 90 degrees (NVidia card+drivers) instead of normal settings (twinView without rotation). Some things like scrolling and typing with 'show whitespace' enabled in Eclipse slowed down extremely. I have reverted to normal orientation and TwinView, and now scrolling is normal, and typing with 'show whitespace' enabled is still slow, but instead of 1 char/s I can type a couple of chars/sec in the worst case. (Still not fast enough).
This is still an issue in 4.2 The method WhitespaceCharacterPainter.paintControl is slow. It's calling 3 slow methods for every visible character on each scroll step: * GC.getFontMetrics() * GC.drawString * StyledText.getLocationAtOffset I think GC.getFontMetrics() can be cached, but maybe the whole Painter must be rewritten because not on every scroll everything must be repainted. Some people may think it's slower on Mac, but that's because they use the trackpad or a mac mouse I think. These devices does a lot more scroll steps per second. see line 229: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt/Eclipse%20SWT/common/org/eclipse/swt/widgets/TypedListener.java?view=markup and see line 498: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java?view=markup
*** Bug 416765 has been marked as a duplicate of this bug. ***
This is an important bugreport! It is not fixed in Kepler 4.3.1 yet and gave me a real headache over weeks. I can confirm that switching off "show whitespace character" made the editor usable again (I use eclipse-photran plugin for Fortran files). Before this I had to restarted eclipse to get better scrolling-speed for a short time again => it made a difference how long eclipse was running.
Does it make sense that this bug is opened against PDT. The description sounds like this would be an issue in any editor that uses the Eclipse text editor, so shouldn't this be opened against the platform?
I'm moving it into platform text. Most of PHP developers prefer spaces instead of tabs, and because each space is rendered separetly, php and any other editor will be typicaly 4x slower than editors with tabs. On big screens this is very painful. In WhitespaceCharacterPainter:351 I see an information about painting problems. They probably have to be fixed.
So far no comment indicated that it's also seen in other editors. So, before moving to the platform, please attach a text or Java file that demonstrates the problem. Also, attaching profiler information that shows where the time is really spent, helps more than guessing.
Update from my side: * php editor is still very slow if there is a lot of whitespace (Eclipse Juno, Ubuntu 13.10) visible. * it does not matter if it is inside or outside php tags * the default text-editor does not suffer from this problem.
*** This bug has been marked as a duplicate of bug 434194 ***