-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slow StyledTextRenderer for unicode and unprintable control characters #414
Comments
Turns out lineCount() is the drawn lines per lines which is ==1 without linewrap. but the shape() will be done anyway to calculate the width of the line. i prefer the notepad++ way to (fast) draw meaningfull symbols instead of undrawable characters: |
Could you please provide a short snippet where this is reproducible with pure SWT? |
@tmssngr here is a pure swt Example:
|
Thanks. I agree, this is really slow. |
@jukzi Eclipse SDK |
just tested, that it is also slow for non-ascii Unicode characters that can be rendered. for example: @merks |
I have added the line to test "non-ascii Unicode characters" after line 17 and inspite of scrolling for almost 10times(up and down) i am seeing the result consistent as below. Able to see some character always unlike yours but nothing missing. Yeah but definitely slow. fyi - This time i tried with a different version of java on RC2 build. |
What would you think - could it be an idea to replace those "characters" below 0x20 with 0x20 before sending to the native renderer? |
At best such characters would be rendered as meaningful symbols like notepad++ does. For example It must be clarified if the performance problem is inside the native renderer or within swt source code. |
There seems to be a complete block with symbols in Unicode: |
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default ' ') for rendering. This improves the performance significantly.
I've sent a proof-of-concept-PR. With your snippet on my Windows 11 it makes no difference whether using \u2400... or a space - in both cases it looks the same. But it is noticeable faster. |
#1425 is good for performance, and i can still copy&paste the right text. [1] https://stackoverflow.com/a/34734338 Unicode, contains 120,737 assigned code points - almost twice as many as fit in a modern font |
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
On windows eclipse text editors sometimes lag when scrolling
I sampled the times and see that most times is spend in
TextLayout.getLineCount() which is called for every line in the handlePaint() loop.
As far as i understand the number of lines won't change while drawing so it should be enough to calculate the number of lines once.
The text was updated successfully, but these errors were encountered: