SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[12.1.279 Pro] - Indent/Unindent slow

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[12.1.279 Pro] - Indent/Unindent slow
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2043

Post [12.1.279 Pro] - Indent/Unindent slow Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7649

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2043

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7649

Post Reply with quote
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 View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 757
Country: United States

Post Reply with quote
IIRC gemisigo uses regions quite a bit. Could it be region related?
Thu Oct 13, 2022 7:28 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2043

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7649

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7649

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2043

Post Reply with quote
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 View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 757
Country: United States

Post Reply with quote
Ahhh I see now. I can confirm this too even in single tab.
Thu Oct 20, 2022 10:24 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7649

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2043

Post Reply with quote
Splendid! Thank you very much!
Fri Oct 21, 2022 9:18 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7649

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2043

Post Reply with quote
I can confirm this is fixed. Thank you very much!
Sat Dec 03, 2022 9:59 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.