[MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
Hi Martin
i made a simple test across msegui & lazarus & wxwidgets to see who's
uses less cpu
the test is very simple : a paintbox & timer , i set the timer
interval to 16ms and in its ontimer event i invalidate the paintbox to
trigger its paint event , in the paint event i draw a rectangle
after execution i maximized the form and see the cpu usage , well the
results was :
msegui : 90% per on cpu core
lazarus : 18%
wxwidgets: 2%

i just wondering why this slowdown from msegui

note :  in wxwidgets there is no paintbox  so i used wxPanel instead
note2 : the screen resolution is 1680x1050

the program :

type
 tmainfo = class(tmainform)
   tpaintbox1: tpaintbox;
   ttimer1: ttimer; // 16ms
   procedure onpaintbox_paint(const sender: twidget; const acanvas: tcanvas);
   procedure on_timer(const sender: TObject);
 end;
var
 mainfo: tmainfo;
implementation
uses
 main_mfm;
procedure tmainfo.onpaintbox_paint(const sender: twidget;
               const acanvas: tcanvas);
begin
        acanvas.fillrect(makerect(30,10,100,50),cl_Red);
end;

procedure tmainfo.on_timer(const sender: TObject);
begin
   tpaintbox1.invalidate;
end;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

msegui.png (39K) Download Attachment
lazarus.png (39K) Download Attachment
wxwidgets.png (38K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
On Sunday 26 August 2018 23:45:08 code dz wrote:

> Hi Martin
> i made a simple test across msegui & lazarus & wxwidgets to see who's
> uses less cpu
> the test is very simple : a paintbox & timer , i set the timer
> interval to 16ms and in its ontimer event i invalidate the paintbox to
> trigger its paint event , in the paint event i draw a rectangle
> after execution i maximized the form and see the cpu usage , well the
> results was :
> msegui : 90% per on cpu core
> lazarus : 18%
> wxwidgets: 2%
>
> i just wondering why this slowdown from msegui
>
You noticed that the MSEgui ttimer.interval are microseconds?
I get 0..1% CPU usage, please see attachment.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

paintspeed.png (96K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
2018-08-27 6:37 UTC+01:00, Martin Schreiber <[hidden email]>:

> On Sunday 26 August 2018 23:45:08 code dz wrote:
>> Hi Martin
>> i made a simple test across msegui & lazarus & wxwidgets to see who's
>> uses less cpu
>> the test is very simple : a paintbox & timer , i set the timer
>> interval to 16ms and in its ontimer event i invalidate the paintbox to
>> trigger its paint event , in the paint event i draw a rectangle
>> after execution i maximized the form and see the cpu usage , well the
>> results was :
>> msegui : 90% per on cpu core
>> lazarus : 18%
>> wxwidgets: 2%
>>
>> i just wondering why this slowdown from msegui
>>
> You noticed that the MSEgui ttimer.interval are microseconds?
> I get 0..1% CPU usage, please see attachment.
>
> Martin
>

the value is 16000 which means 16ms
at first i thought maybe its due to double buffering, but i also used
doublebuffering in both lazarus and wxwidgets and gives me the same
results

note i don't know about linux but i use windows7

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
On 27.08.2018 08:45, code dz wrote:

> note i don't know about linux but i use windows7
>
I get 0% CPU load on Windows 7 including the display of the loop count,
runtime and interval, please see attachment. A virus protection problem
maybe?

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

paintperformance.PNG (115K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
In reply to this post by code dz
On 26.08.2018 23:45, code dz wrote:

> Hi Martin
> i made a simple test across msegui & lazarus & wxwidgets to see who's
> uses less cpu
> the test is very simple : a paintbox & timer , i set the timer
> interval to 16ms and in its ontimer event i invalidate the paintbox to
> trigger its paint event , in the paint event i draw a rectangle
> after execution i maximized the form and see the cpu usage , well the
> results was :
> msegui : 90% per on cpu core
> lazarus : 18%
> wxwidgets: 2%
>
> i just wondering why this slowdown from msegui
>
Why is the background of the MSEgui example white?

Martin


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
2018-08-27 9:43 UTC+01:00, Martin Schreiber <[hidden email]>:

> On 26.08.2018 23:45, code dz wrote:
>> Hi Martin
>> i made a simple test across msegui & lazarus & wxwidgets to see who's
>> uses less cpu
>> the test is very simple : a paintbox & timer , i set the timer
>> interval to 16ms and in its ontimer event i invalidate the paintbox to
>> trigger its paint event , in the paint event i draw a rectangle
>> after execution i maximized the form and see the cpu usage , well the
>> results was :
>> msegui : 90% per on cpu core
>> lazarus : 18%
>> wxwidgets: 2%
>>
>> i just wondering why this slowdown from msegui
>>
> Why is the background of the MSEgui example white?
>
> Martin
>
>

i just set the paintbox color to white .
but if the antivirus is the problem , why wxwidgets example uses 1%  cpu ?

what is the resolution of your display ?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
On Monday 27 August 2018 14:25:45 code dz wrote:

> 2018-08-27 9:43 UTC+01:00, Martin Schreiber <[hidden email]>:
> > On 26.08.2018 23:45, code dz wrote:
> >> Hi Martin
> >> i made a simple test across msegui & lazarus & wxwidgets to see who's
> >> uses less cpu
> >> the test is very simple : a paintbox & timer , i set the timer
> >> interval to 16ms and in its ontimer event i invalidate the paintbox to
> >> trigger its paint event , in the paint event i draw a rectangle
> >> after execution i maximized the form and see the cpu usage , well the
> >> results was :
> >> msegui : 90% per on cpu core
> >> lazarus : 18%
> >> wxwidgets: 2%
> >>
> >> i just wondering why this slowdown from msegui
> >
> > Why is the background of the MSEgui example white?
> >
> > Martin
>
> i just set the paintbox color to white .

Please send your test project.

> but if the antivirus is the problem , why wxwidgets example uses 1%  cpu ?
>
Because it is not tracked by your antivirus program and the MSEgui application
is? I don't know.

> what is the resolution of your display ?
>
1920x1080.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
i disabled the antivirus but the result still the same , i also
noticed that if i enabled to_leak
the cpu usage reduced to 35
ok seems this problem exist only on this laptop (hp compaq 8710w
mobile workstation) , i have another pc runing windows7 and the app
almost uses 0% cpu .

any idea on how to debug such problem !

thanks

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

test1.7z (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

Sieghard
Sehr geehrter Herr dz,

Sie schrieben am Mon, 27 Aug 2018 21:51:38 +0100:

> i disabled the antivirus but the result still the same , i also
> noticed that if i enabled to_leak
> the cpu usage reduced to 35
> ok seems this problem exist only on this laptop (hp compaq 8710w
> mobile workstation) , i have another pc runing windows7 and the app
> almost uses 0% cpu .

Seems it uses the generic VESA video driver. Do you have a manufacturer
provided driver for this laptop? Then you should perhaps consider installing
that and trying again.

--
--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
2018-08-27 23:24 UTC+01:00, Sieghard <[hidden email]>:

> Sehr geehrter Herr dz,
>
> Sie schrieben am Mon, 27 Aug 2018 21:51:38 +0100:
>
>> i disabled the antivirus but the result still the same , i also
>> noticed that if i enabled to_leak
>> the cpu usage reduced to 35
>> ok seems this problem exist only on this laptop (hp compaq 8710w
>> mobile workstation) , i have another pc runing windows7 and the app
>> almost uses 0% cpu .
>
> Seems it uses the generic VESA video driver. Do you have a manufacturer
> provided driver for this laptop? Then you should perhaps consider installing
> that and trying again.
>

Hi
yes it is installed and updated already , i get the drivers from here :
https://support.hp.com/us-en/drivers/selfservice/hp-compaq-8710w-mobile-workstation/3355679

well i think its msegui issue !! , but i don't know how to debug this
kind of problems

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
In reply to this post by code dz
On Monday 27 August 2018 22:51:38 code dz wrote:

I get 0% CPU with your program too.

> i disabled the antivirus but the result still the same , i also
> noticed that if i enabled to_leak
> the cpu usage reduced to 35

to_leak drops missed calls if "interval" time already has expired if "ontimer"
returns.

> ok seems this problem exist only on this laptop (hp compaq 8710w
> mobile workstation) , i have another pc runing windows7 and the app
> almost uses 0% cpu .
>
> any idea on how to debug such problem !
>
First check if onpaint is really called in 16 ms intervals. Add a counter in
onpaint and display runtime / count.
If this is OK or > 16 ms then interrupt the program by 'Target'-'Interrupt'
several times and check in stack window where it normally spends time.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
i added  a counter and yes paint event triggered every 16ms
i interrupt the application as you suggest me , you can see the call
stack pictures

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

callstac.7z (271K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
On Tuesday 28 August 2018 23:15:09 code dz wrote:
> i added  a counter and yes paint event triggered every 16ms
> i interrupt the application as you suggest me , you can see the call
> stack pictures

Interesting that there is no fillrect() or bitblt() or other *blt() call which
consumes the most time which one would expect for the big invalidated area if
there would be no hardware acceleration.
I am helpless.

It looks like a 32 bit application, is Windows 32 bit too?

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
In reply to this post by code dz
On Tuesday 28 August 2018 23:15:09 code dz wrote:
> i added  a counter and yes paint event triggered every 16ms
> i interrupt the application as you suggest me , you can see the call
> stack pictures

Please additionally add a counter to twidget.paint()
(lib/common/kernel/msegui.pas:10614)  and check the calling frequency.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
In reply to this post by mse
2018-08-29 6:49 UTC+01:00, Martin Schreiber <[hidden email]>:

> On Tuesday 28 August 2018 23:15:09 code dz wrote:
>> i added  a counter and yes paint event triggered every 16ms
>> i interrupt the application as you suggest me , you can see the call
>> stack pictures
>
> Interesting that there is no fillrect() or bitblt() or other *blt() call
> which
> consumes the most time which one would expect for the big invalidated area
> if
> there would be no hardware acceleration.
> I am helpless.
>
> It looks like a 32 bit application, is Windows 32 bit too?
>
> Martin
>

yes it is 32bits

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
In reply to this post by mse
2018-08-29 9:37 UTC+01:00, Martin Schreiber <[hidden email]>:

> On Tuesday 28 August 2018 23:15:09 code dz wrote:
>> i added  a counter and yes paint event triggered every 16ms
>> i interrupt the application as you suggest me , you can see the call
>> stack pictures
>
> Please additionally add a counter to twidget.paint()
> (lib/common/kernel/msegui.pas:10614)  and check the calling frequency.
>
> Martin
>

i am at work , i'll check in the evening and tell you what i've got

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
In reply to this post by mse
2018-08-29 9:37 UTC+01:00, Martin Schreiber <[hidden email]>:

> On Tuesday 28 August 2018 23:15:09 code dz wrote:
>> i added  a counter and yes paint event triggered every 16ms
>> i interrupt the application as you suggest me , you can see the call
>> stack pictures
>
> Please additionally add a counter to twidget.paint()
> (lib/common/kernel/msegui.pas:10614)  and check the calling frequency.
>
> Martin
>

i've added a counter , the frequency is 600 call/sec
is this normall ?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
On Wednesday 29 August 2018 18:21:28 code dz wrote:

> 2018-08-29 9:37 UTC+01:00, Martin Schreiber <[hidden email]>:
> > On Tuesday 28 August 2018 23:15:09 code dz wrote:
> >> i added  a counter and yes paint event triggered every 16ms
> >> i interrupt the application as you suggest me , you can see the call
> >> stack pictures
> >
> > Please additionally add a counter to twidget.paint()
> > (lib/common/kernel/msegui.pas:10614)  and check the calling frequency.
> >
> > Martin
>
> i've added a counter , the frequency is 600 call/sec
> is this normall ?
>
I would expect 3 times the timer rate for a single widget (tpaintbox) in the
form. So it is higher than expected but not so high that it explains the CPU
load difference 0% -> 100%.
I am still helpless.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

code dz
2018-08-29 17:31 UTC+01:00, Martin Schreiber <[hidden email]>:

> On Wednesday 29 August 2018 18:21:28 code dz wrote:
>> 2018-08-29 9:37 UTC+01:00, Martin Schreiber <[hidden email]>:
>> > On Tuesday 28 August 2018 23:15:09 code dz wrote:
>> >> i added  a counter and yes paint event triggered every 16ms
>> >> i interrupt the application as you suggest me , you can see the call
>> >> stack pictures
>> >
>> > Please additionally add a counter to twidget.paint()
>> > (lib/common/kernel/msegui.pas:10614)  and check the calling frequency.
>> >
>> > Martin
>>
>> i've added a counter , the frequency is 600 call/sec
>> is this normall ?
>>
> I would expect 3 times the timer rate for a single widget (tpaintbox) in the
>
> form. So it is higher than expected but not so high that it explains the CPU
>
> load difference 0% -> 100%.
> I am still helpless.
>
> Martin
>

in fact it is not 1 widget , its 3
1 tpaintbox and 2 tintegerdisp

ok i'll try to investigate more later

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] a little benchmark (msegui lazarus wxwidgets)

mse
Administrator
On 08/29/2018 07:01 PM, code dz wrote:
>
> in fact it is not 1 widget , its 3
> 1 tpaintbox and 2 tintegerdisp
>
+ form + container = 5 widgets
-> expected frequency = 5 * 1/16ms = 313
If you update the values of the display widgets there will be more paint
events.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk