[Lazarus] Animation library

Michael Van Canneyt michael at freepascal.org
Mon Feb 27 22:52:09 CET 2017



On Mon, 27 Feb 2017, José Mejuto via Lazarus wrote:

>> 2) I have a 4 core system with hyper threading (ie: 4 cores and 4
>>    virtual cores). Your sample application maxed out all 8 cores at
>>    100% CPU load. Not really acceptable behaviour for a desktop
>>    application I would think. ;-)
>
> The library animate controls properties, like position and color at the 
> rate set by the "tmrAnimationCadence" timer. Maybe Linux LCL takes ages 
> to update control positions or the backend widgetset. The CPU use for 
> the library operations are almost 0% but repaint the form is CPU 
> intensive specially in Linux, based in your observations. There is no 
> reason that more than one core is used (no threading) so the widgetset 
> or LCL interface is pushing it to its limits.
>
> You can try to remove the "Self.Refresh" in the tmrAnimationCadence 
> event and also raise the tmrAnimationCadence.Interval to 30 (in the 
> published code its value is 1, but it should be 15, but in Windows 
> difference between 15 and 1 is zero, in Linux you can set timers with 1 
> ms. precision which is terrible overkill).

I put it on 30, but as with Graeme, the CPU goes to well over 100%
(2 cores are involved in the process, or so it seems)

Michael.


More information about the Lazarus mailing list