Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[12.1.279 Pro] - Indent/Unindent slow |
|
Indenting or unindenting the code is painfully slow when I have more than a few lines selected. By more than a few I mean it gets noticeably slow for as few as a dozen, indenting them takes about 2 seconds. Indenting 130 lines takes almost 7 seconds, and while waiting the status bar flickers like crazy. Check this short video here.
In the video, the editor was set to use spaces (which is how I usually use SE for reasons we have already discussed in other posts). Also, when pasting code from other sources that contain TABs, the editor instantly replaces them with spaces (which is good), but it takes ages (not so good). The conversion after pasting a source code of 204 lines / 8626 characters took ~27 seconds. This gave me an idea of why indenting might be slow. I thought the editor converts TABs and spaces back and forth each TAB/space for every line it has to indent/unindent. But that might not be the case though, because it is just as slow when using TABs.
|
|
Fri Oct 07, 2022 9:34 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I tested this with 10 KB and 3.5 MB files. Indenting and unindenting appears to be fast regardless of the file size. But as soon as I start using code folding, even if it's a simple two line block BEGIN...END, indenting slows down significantly. The CPU usage jumps too, up to 25% when testing it with 3.5 MB file. It makes me think that indenting triggers something intense recalculating code folding states and maybe something else.
Please try it without code folding. Can you reproduce it?
|
|
Mon Oct 10, 2022 10:47 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
I've tried disabling it by using the View/Toggle Folding menu item but experienced no difference in behavior afterwards.
|
|
Wed Oct 12, 2022 8:49 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Are there any open Bookmarks or maybe a code structure tabs open on the right hand side which we can't see. Is it reproducible with any file?
|
|
Thu Oct 13, 2022 5:27 pm |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
IIRC gemisigo uses regions quite a bit. Could it be region related?
|
|
Thu Oct 13, 2022 7:28 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
I can reproduce it with any content/file.
Check this short video here.
It only has 19 lines (the first two are even empty), and there aren't any bookmarks or regions. Also, the Control characters are shown, and there's nothing off-screen. Every time I indent/unindent, the row:column (byte) indicator flickers like crazy. It is observable even for a single line but becomes more apparent when several lines are selected. In the video, in the first post, it can be seen that for a large number of lines selected, the byte indicator increments very rapidly by one until it finishes indenting all the lines. Watching the video I had the funny feeling that it adds a space to the first line and then checks if it is okay and then adds another one, rechecks, and repeats this for the first line until it is satisfied that the line is indented as requested. And then repeats that whole process for each line, one by one. That gave me the idea and I checked it if switching spaces to TABs in the editor changes anything. Alas, it did not. It does not seem to be even a bit faster using TABs.
|
|
Mon Oct 17, 2022 8:18 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Thank you for the video, I submitted a ticket for your case. It obviously does something internally, but what, I can't tell.
|
|
Mon Oct 17, 2022 7:41 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I think we have figured out the root cause and why we were unsuccessful in reproducing it earlier.
Could you please try it with the only tab connected to that same database? Should be indenting significantly faster, right?
|
|
Tue Oct 18, 2022 9:45 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
I've tried it with a single editor running with a single tab open. It was indeed significantly faster for the lines selected when there were only those 19 lines. However, trying to indent multiple lines in a file containing 169 lines is still very slow. For 30 lines it is between 1 and 2 secs, for 50 lines it takes more than 2 secs. 100 lines go ~4 secs. What did you find?
|
|
Thu Oct 20, 2022 9:53 am |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
Ahhh I see now. I can confirm this too even in single tab.
|
|
Thu Oct 20, 2022 10:24 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
We found it regressed after some internal functions were updated to synchronize things across tabs. The objective was improving internal operations in a different area.
I can say that a fix is going to be provided in 12.2, it's already queued.
|
|
Thu Oct 20, 2022 4:08 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Splendid! Thank you very much!
|
|
Fri Oct 21, 2022 9:18 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
This issue is supposed to be fixed in the latest 12.2 released. Please upgrade to 12.2.
|
|
Fri Dec 02, 2022 3:57 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
I can confirm this is fixed. Thank you very much!
|
|
Sat Dec 03, 2022 9:59 am |
|
 |
|