Recent

Author Topic: Windows with many controls paint slowly on Windows  (Read 10893 times)

wp

  • Hero Member
  • *****
  • Posts: 12860
Re: Windows with many controls paint slowly on Windows
« Reply #15 on: November 29, 2017, 10:07:40 pm »
Hi again,

Here is the video capture that I derived the animated GIF from.  In the video, I restore and minimize the form from the Free Pascal demo project I made a few times, and you can see the slow drawing.  Later, I restore and minimize a demo Java app with the same amount of controls, which shows absolutely zero drawing latency.

Video capture of slow form drawing
I was confused by the screen background image. So you mean the very short delay, maybe 0.1 sec or less, during which all controls build up?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Windows with many controls paint slowly on Windows
« Reply #16 on: November 29, 2017, 10:24:19 pm »
Hi again,

Here is the video capture that I derived the animated GIF from.  In the video, I restore and minimize the form from the Free Pascal demo project I made a few times, and you can see the slow drawing.  Later, I restore and minimize a demo Java app with the same amount of controls, which shows absolutely zero drawing latency.

Video capture of slow form drawing
I was confused by the screen background image. So you mean the very short delay, maybe 0.1 sec or less, during which all controls build up?
which is slower than java! which shows a problem on the design or implementation.
Slower than java? really? and that is not a problem?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

willbprog9933

  • Jr. Member
  • **
  • Posts: 93
  • Big guy, tiny brain :P
    • BrainOut!
Re: Windows with many controls paint slowly on Windows
« Reply #17 on: November 29, 2017, 11:30:38 pm »
I was confused by the screen background image. So you mean the very short delay, maybe 0.1 sec or less, during which all controls build up?

Yes, that's correct.  I am not using a background image on my form, but the desktop pic is showing through while the form builds up. :)
macOS, Linux, FreeBSD and sometimes OpenIndiana.

Blessed, loved and forgiven! :D

wp

  • Hero Member
  • *****
  • Posts: 12860
Re: Windows with many controls paint slowly on Windows
« Reply #18 on: November 30, 2017, 12:35:33 am »
Background image showing through? I don't see this here on Win 10. Setting several breakpoints somewhere during the painting cycle I get the impression that at first a white form background is painted, then the border of the edits is drawn, and finally the formbackground becomes gray (clBtnFace) and the labels appear. The quick alteration from white to gray background certainly is perceived as flicker.

My Win7-VM is not as fast as yours but I think that the background shows through there too. This difference could be due to the Aero effects of Win7. What if you turn Aero off?

willbprog9933

  • Jr. Member
  • **
  • Posts: 93
  • Big guy, tiny brain :P
    • BrainOut!
Re: Windows with many controls paint slowly on Windows
« Reply #19 on: November 30, 2017, 12:51:03 am »
My Win7-VM is not as fast as yours but I think that the background shows through there too. This difference could be due to the Aero effects of Win7. What if you turn Aero off?

This is with Aero off.  I don't like Aero myself, so that was already turned off years ago. ;)

Looks like I'll just have to ignore this, then.  It bugs me greatly but one of my colleagues says he barely notices it.  It's possible my brain is unusually sensitive to this slow painting while other's don't see it at all.  It might explain why I'm the only one who thinks X11 is slow on Debian while on other distros it's fine. :shrugs:
macOS, Linux, FreeBSD and sometimes OpenIndiana.

Blessed, loved and forgiven! :D

Josh

  • Hero Member
  • *****
  • Posts: 1375
Re: Windows with many controls paint slowly on Windows
« Reply #20 on: November 30, 2017, 04:05:08 am »
Hi

Have you tried setting the form doublebuffering to true in the form on create event, this should help any flicker.
ypu could also try placing all the controls on a panel, and have the panel visibility set to false in design time, then on form onshow event make the panel visible; this would work better if the panels doublebuffering was set to true also.

Quick mod of your app, if you can try it it may be ok.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

willbprog9933

  • Jr. Member
  • **
  • Posts: 93
  • Big guy, tiny brain :P
    • BrainOut!
Re: Windows with many controls paint slowly on Windows
« Reply #21 on: November 30, 2017, 06:03:08 am »
Have you tried setting the form doublebuffering to true in the form on create event, this should help any flicker.
ypu could also try placing all the controls on a panel, and have the panel visibility set to false in design time, then on form onshow event make the panel visible; this would work better if the panels doublebuffering was set to true also.

Hi Josh,

Thanks for the modded project.  When compiled, it does paint a little quicker, with a less noticeable draw time than my original one, so thanks for giving me those pointers!  I did try the DoubleBuffering before, but only on the form and not on panels.

Thanks again! :)
macOS, Linux, FreeBSD and sometimes OpenIndiana.

Blessed, loved and forgiven! :D

wp

  • Hero Member
  • *****
  • Posts: 12860
Re: Windows with many controls paint slowly on Windows
« Reply #22 on: November 30, 2017, 09:26:26 am »
I converted your project from reply #8 to Delphi, and my impression is that its exe behaves in the same way as the Lazarus exe. It's hard to see, though.

willbprog9933

  • Jr. Member
  • **
  • Posts: 93
  • Big guy, tiny brain :P
    • BrainOut!
Re: Windows with many controls paint slowly on Windows
« Reply #23 on: November 30, 2017, 05:49:31 pm »
I converted your project from reply #8 to Delphi, and my impression is that its exe behaves in the same way as the Lazarus exe. It's hard to see, though.

Thank you wp :)  I'll just have to deal with it.  As mentioned before, my closest colleague says the painting slowness isn't that noticeable to him, and others here have echoed that, so I'll just tolerate it, I guess. :)
macOS, Linux, FreeBSD and sometimes OpenIndiana.

Blessed, loved and forgiven! :D

 

TinyPortal © 2005-2018