[Lazarus] Animation library

José Mejuto joshyfun at gmail.com
Wed Mar 1 20:47:45 CET 2017

El 27/02/2017 a las 15:15, Graeme Geldenhuys via Lazarus escribió:

> 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. ;-)


Performed some tests today using VirtualBox, Ubuntu 14.04.02 and Centos 
6.7, both 32 bits using Windows 7 as host with a CPU i7 (3 cores for 
virtual machines and 2 gigabytes of RAM).

- Default configuration from Virtualbox the animation takes CPU near 
100% in all cores with compiz using 95% of CPU wichever frames per 
second I use. The Windows manager is damn slow, just open Lazarus and 
move components around a form is sloooowwww.
- Activated 3D acceleration and now animation is good at ~60 frames per 
second with an average CPU of 10-15%. Also removed the FPS in caption as 
only that update takes 50% CPU sometimes, something is wrong in compiz 
with windows captions.
- Host Windows 7 machine with Ubutu animation running uses around 12-16% 
CPU for the VirtualBox.

- Gnome with default VirtualBox configuration (no 3D acceleration) works 
fine at ~60 frames per second once Form.Caption update is removed as it 
consumes CPU (only form.caption update consumes 60% CPU sometimes).

Ubuntu compiz needs 3D acceleration to be usable and has window caption 
bugs, the update of caption produces artifacts in form controls like 
missing draws, blank zones, ghost lines, ... Of course this could have 
some relation with LCL updating the caption as its CPU consume is 
insane. In the other hand, form.caption update in GNome works quite 
well, not as smooth as Ubuntu but quite similar to Windows7.

In linux Form.invalidate/repaint seems to work different than in 
Windows, as in Linux it seems to not remove queued paints, so moving a 
control and just issue a form.invalidate the system paints the control 
and children controls and then form.invalidate paints all of them again. 
In windows AFAIK when form.invalidate is called all paints in the queue 
are removed (related to that window) without being processed and then 
form.invalidate is performed.

I wish to know if somebody think this is useful, to expand it, or just 
don't take more time developing it and keep it to my projects.

Thank you.


More information about the Lazarus mailing list