Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #195575 +++ 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.
Besides StyledText.getLocationAtOffset(int) being slow (see bug 195575) 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(int).
Created attachment 77716 [details] Fix This patch improves performance for long lines by computing the visible part of each line before painting. Binary search was not necessary.
I've patched my installation with this fix, and now there is no noticeable difference between opening "long line" files with or without whitespace characters enabled. Looks good to me!
Thanks Anton! Committed to HEAD. Available in builds >= I20070911-0800.