Community
Participate
Working Groups
Build ID: I20070625-1500 Steps To Reproduce: 1. Enable the "Show Whitespace Characters" feature. 2. Open a file containing a long line of data (>100 kB works well) in a text-based editor (text editor, or XML editor in Source mode). 3. Observe that Eclipse becomes unresponsive for 30+ seconds with 100% CPU utilization in Eclipse.exe. Turning off the "Show Whitespace Characters" feature reduces this to about < 3 seconds. More information: Test machine is 2 GHz with 2 GB RAM, running Win2k.
I forgot to clarify - the issue here is long line lengths, not large files overall. I commonly experience this on "unformatted" file types, such as non-formatted XML (the entire file is on one line), or other data types absent of line breaks. I've not looked into the source code yet, but one guess is an operation that's trying to buffer "per line" rather than per a given block of characters.
The main reason is the slow performance of computing the location for a given offset (see attached screenshot from the profiler). Adding Anton who provided the initial implementation of the WhitespaceCharacterPainter. Anton, the WhitespaceCharacterPainter could be improved by not looping from start to end offset but instead do it line by line so that we can cut off at left and right of the viewport. Left and right need to be computed à la binary seach to minimize the calls to getLocationAtOffset(...). Could you look into that? If so we can clone that bug. Moving to SWT to check whether they can improve the performance.
(In reply to comment #2) > Could you look into that? If so we can clone that bug. I can look into it for 3.4.
Thanks Anton. I've created bug 196116 for that.
fixed in HEAD > 20070907 I changed TextLayout#getLocation and TextLayout#getOffset to use a binary search to find the run (used be linear search).
Felipe please verify that this fix is already in 3.4.x.
(In reply to comment #6) > Felipe please verify that this fix is already in 3.4.x. It is there already.