EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Performance of when clause
From: Benjamin Franksen <[email protected]>
To: Janez Golob <[email protected]>, <[email protected]>
Date: Tue, 18 Nov 2014 10:45:47 +0100
On Tuesday 18 November 2014 09:31:47 Janez Golob wrote:
> Hello,
>
> Recently I did some measurements to determine how much time a
> sequencer program needs to detect a change of a channel or en event
> flag. The two use cases are shown below:
>
>     state wait_command
>     {
>         when (start) { } state ...
>     }
>
>     state wait_event_flag
>     {
>         when (efTestAndClear(rdy_flag1)) { } state ...
>         when (efTestAndClear(rdy_flag2)) { } state ...
>         when (efTestAndClear(rdy_flag3)) { } state ...
>     }
>
> Start is an integer connected to a single channel. Rdy_flag1..3 are
> event flags associated with three arrays (each array contains around
> hundred of channels).
>
> My measurements show that in the first case the sequncer program
> starts executing when clause in below ms range and in the second case
> it takes around 93ms. I am getting almost the same figures on vxWorks
> (PowerPC CPU) and win32-x86 (i7 CPU) targets.
>
> Is this expected behavior? I would expect almost the same figure in
> both cases.

Hi Janez

your observations are interesting, but I would rather not use the word
"performance" here, as this is likely a matter of latency, rather than
burning more or less CPU cycles. (I am assuming both your test programs
contain the same channel and monitor declarations, so that there is no
extra load in the second case due to the monitor event processing.)

In your setting I would expect a somewhat higher latency for the event
flag screnario because each CA monitor event for one of the channels in
your array(s) contends for the same lock that efTestAndClear takes. But
I had not expected the difference to be that large.

It would be interesting to measure the frequency of the CA monitor
events for the channels contained in your arrays and see if there are
perhaps many such events happening at about the same time.

Cheers
Ben
--
"Make it so they have to reboot after every typo." ― Scott Adams

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de


Navigate by Date:
Prev: Re: Andor - Area Detector Zenon Szalata
Next: how to execute 'mcaget/mcaopen/...' command on IOCSHELL JaeRyong Seo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Andor - Area Detector Zenon Szalata
Next: how to execute 'mcaget/mcaopen/...' command on IOCSHELL JaeRyong Seo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024