Extremely slow redraw of 'Connect to ftp server' dialog
Moderators: Hacker, petermad, Stefan2, white
Extremely slow redraw of 'Connect to ftp server' dialog
First, the folders and icons for connections are great, exactly as I hoped for. :)
But the redrawing of connections list is _terribly_ slow. When resizing the dialog window, it eats 100% cpu and it can be clearly seen that it's redrawing the whole list over and over (clears the whole background, then again draws all items one by one). And it does not make more than five updates per second. Even when just selecting different items, there is visible flicker.
Is there any reason why standard TTreeView is not used? It's lightning fast, compared to this.
But the redrawing of connections list is _terribly_ slow. When resizing the dialog window, it eats 100% cpu and it can be clearly seen that it's redrawing the whole list over and over (clears the whole background, then again draws all items one by one). And it does not make more than five updates per second. Even when just selecting different items, there is visible flicker.
Is there any reason why standard TTreeView is not used? It's lightning fast, compared to this.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This is a known limitation because TC has to get the icon state dynamically for the connections (secure ftp or not, password encrypted or not).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
pb2: Flickering on resize is gone. The control still redraws noticeably slower compared to system treeview, but it's not that bad.
One little problem remains:
- move mouse to some non-selected item
- press and hold left button -> focus moves correctly
- release the button -> selected item blinks; it seems it's redrawn with white background first and then again with 'selected' color
One little problem remains:
- move mouse to some non-selected item
- press and hold left button -> focus moves correctly
- release the button -> selected item blinks; it seems it's redrawn with white background first and then again with 'selected' color
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
I think that's how you do that when you want to draw controls by yourself. Such method is not limited to coding onlySob wrote:it seems it's redrawn with white background first and then again with 'selected' color

Last edited by fenix_productions on 2009-05-03, 17:05 UTC, edited 1 time in total.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...
#128099
#128099
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks for confirming the fix! Indeed the focus flickering is caused by Windows, it requests an unfocused redraw first, and then a focused redraw...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Strange, I don't have this problem any more on my slow Pentium III with 866 MHz. How fast is your computer?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Core2Duo 1,8GHz. ATI X1400. Beta 4. WinXP SP2.
I'm not sure whether it really qualifies as "slow", but I don't think I should type three letters and then watch for almost a second how it does two more redraws, or that scrolling with scrollbar should be very "choppy" - I have around 300 connections defined and scrolling though I can see single redraws.
Eats one processor core (~95% when scrolling back and forth).
I'm not sure whether it really qualifies as "slow", but I don't think I should type three letters and then watch for almost a second how it does two more redraws, or that scrolling with scrollbar should be very "choppy" - I have around 300 connections defined and scrolling though I can see single redraws.
Eats one processor core (~95% when scrolling back and forth).
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Wow, that's incredibly slow! Here it's almost instantaneous with my slow PC and active virus scanner!
Maybe you have an extremely slow scanner? Try to disable it temporarily. If it helps, try to exclude wcx_ftp.ini from the scan process.
Maybe you have an extremely slow scanner? Try to disable it temporarily. If it helps, try to exclude wcx_ftp.ini from the scan process.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I must also say that the whole thing still "feels" quite slow. The change between PB1 and PB2 was big, so it seemed as problem solved, but after using it a little more, I'd say no.
I don't know if drawing tree in ListBox simply can't be faster or if it's something else.
I spotted one thing: when the dialog is opened, the display of items is not instant. It seems like they are added one by one, at least on the vertical scrollbar it's clearly visible gradual resizing. And the same is when you open the folder. Maybe this is where the slow feel comes from?
I don't know if drawing tree in ListBox simply can't be faster or if it's something else.
I spotted one thing: when the dialog is opened, the display of items is not instant. It seems like they are added one by one, at least on the vertical scrollbar it's clearly visible gradual resizing. And the same is when you open the folder. Maybe this is where the slow feel comes from?
Actually, I don't run any antivirus software. And no, I don't have a virus and am confident about it
Nor any other software that would scan files. When I check per process CPU usage, around one third is by TC itself and the rest by system, or rather "Inactive system processes", or how it's in English.
I'll try whether I can replicate the problem on any other computer.

I'll try whether I can replicate the problem on any other computer.