Community
Participate
Working Groups
I20090513-2000. When having large text (e.g. StyledText.java) in the text editor and then select all the editor becomes unresponsive. The reason for this is slow performance of StyledText.getSelectionRanges().
Created attachment 135752 [details] Perf Data
Not sure what to do the improve the performance here. Here is the problem, the block selection is a geometry shape on top of the text. When the user call getSelectionRanges(), StyledText finds the line at the top edge of the block selection and the line at the bottom. Then it loops from that first line to the last line finding the offsets in each line that intersect with the left and right edge of block selection. If the application calls select all, all lines are select. If the file is StyledText, which has 9425 lines of code. It means that getSelectionRanges() will have to perform 9425*2 hit tests. Note also that only a few lines will be in the cache (the lines in the client area), for the majority of lines StyledText will have to initialize them. That said, I can add a special case: detect when the block selection rectangle entirely covers the document and return {0, charCount} in getSelectionRanges(). This should fix the selectAll()/getSelectionRanges() problem. The generic case: 'block selection rectangle too large makes getSelectionRanges() slow', that I don't know how to fix.
I didn't notice select all getting faster using the patch in bug 276345 (getSelectionRanges is not running), can you profile again with the patch ?
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
This is a one-off bulk update. (The last one in the triage migration). Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process: https://wiki.eclipse.org/SWT/Devel/Triage See Bug 518478 for details. Tag for notification/mail filters: @TriageBulkUpdate
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.