Argonne National Laboratory

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  2014  2015  2016  <2017 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: registerRecordDeviceDriver.pl takes a long time to finish
From: Michael Davidsaver <mdavidsaver@gmail.com>
To: "Johnson, Andrew N." <anj@aps.anl.gov>, Hinko Kocevar <hinkocevar@gmail.com>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Wed, 27 Sep 2017 11:17:18 -0500
To add a data point with Debian Linux 8 and 9 and Base 3.16.1.  (I've
also see significant slowness)

Building the simplest IOC for 6 targets.  So dbExpand.pl is run once and
registerRecordDeviceDriver.pl is run 6 times.

> $ ../bin/linux-x86_64/makeBaseApp.pl -t ioc foo
> $ time make -s
> 
> real    0m44.828s
> user    0m43.800s
> sys     0m0.436s
> $ make distclean
> $ time make -sj4
> 
> real    0m27.115s
> user    1m5.956s
> sys     0m0.744s

For a single target the "real" times are 8.7 and 7.6 sec.  Basically no
parallelization.

For 6 targets, looking at the CPU load graph (attached) shows a
bottleneck at ~25% (1 of 4 cores) early in the build.

The dbdExpand.pl and registerRecordDeviceDriver.pl steps specifically

> (cd /home/mdavidsaver/work/epics/base-git/tmp/fooApp/src/O.linux-x86_64 && time perl -CSD /home/mdavidsaver/work/epics/base-git/bin/linux-x86_64/dbdExpand.pl   -I. -I.. -I../O.Common -I../../../dbd -I../../../../dbd -o foo.dbd base.dbd)
> 
> real    0m1.241s
> user    0m1.228s
> sys     0m0.012s

> (cd /home/mdavidsaver/work/epics/base-git/tmp/fooApp/src/O.linux-x86_64 && time perl -CSD /home/mdavidsaver/work/epics/base-git/bin/linux-x86_64/registerRecordDeviceDriver.pl   -I. -I.. -I../O.Common -I../../../dbd -I../../../../dbd    -o foo_registerRecordDeviceDriver.cpp ../O.Common/foo.dbd foo_registerRecordDeviceDriver /home/mdavidsaver/work/epics/base-git/tmp)
> real    0m5.836s
> user    0m5.828s
> sys     0m0.004s

I hadn't noticed this difference before.  It seems like these scripts
should be doing almost the same work.


I don't think this is perl interpreter startup time.  (I've never
noticed makeMakefile.pl taking any time)

> 
> time perl -e 'print "Hello\n"'
> Hello
> 
> real    0m0.007s
> user    0m0.008s
> sys     0m0.000s
> 
> time perl -CSDL -e 'print "Hello\n"'
> Hello
> 
> real    0m0.008s
> user    0m0.004s
> sys     0m0.000s
> 
> time perl -C -e 'print "Hello\n"'
> Hello
> 
> real    0m0.004s
> user    0m0.000s
> sys     0m0.000s



On 09/27/2017 10:32 AM, Johnson, Andrew N. wrote:
> Hi Hinko,
> 
> On Sep 27, 2017, at 5:15 AM, Hinko Kocevar <hinkocevar@gmail.com> wrote:
>>
>> Under 3.15.4 perl script execution takes a lot of time on Linux Mint, while it executes in a jiffy on CentOS.
>> I added a time in front of the perl call in RULES.db:
>>
>>
>> time perl -CSD /devel/root/R3.15.4/base/bin/linux-x86_64/registerRecordDeviceDriver.pl   -I. -I.. -I../O.Common -I../../../dbd -I/devel/root/R3.15.4/modules/adcore-master/dbd -I/devel/root/R3.15.4/modules/adsimdetector-master/dbd -I/devel/root/R3.15.4/modules/asyn-master/dbd -I/devel/root/R3.15.4/modules/autosave-master/dbd -I/devel/root/R3.15.4/modules/busy-master/dbd -I/devel/root/R3.15.4/modules/calc-master/dbd -I/devel/root/R3.15.4/modules/sscan-master/dbd -I/devel/root/R3.15.4/base/dbd    -o simDetectorApp_registerRecordDeviceDriver.cpp ../O.Common/simDetectorApp.dbd simDetectorApp_registerRecordDeviceDriver /devel/stage/R3.15.4/iocs/simdetectorioc-master
>>
>>
>> 29.95user 0.02system 0:29.98elapsed 99%CPU (0avgtext+0avgdata 19256maxresident)k
>>
>>
>> I think other calls to perl are awfully slow, too..
>> Any idea why it might be so slow?
> 
> This sounds more like a problem with your Linux Mint system configuration than with the EPICS scripts, I run Linux Mint on my personal laptop at home and don’t see these kinds of issues.
> 
> I wonder if this may be related to different Locale settings. Is this slow:
>     time perl -CSD -e 'print "Hello\n"'
> 
> If yes, please try this
>     time perl -e ‘print "Hello\n"'
> and then this
>     time perl -CSDL -e 'print "Hello\n"'
> and this
>     time perl -C -e 'print "Hello\n"'
> to see if the flags make any difference. What is your locale set to (echo $LANG) and maybe try changing it to see if that has any effect.
> 
> Please report any interesting findings back here...
> 
> HTH,
> 
> - Andrew
> 

Attachment: cpuload.png
Description: PNG image


References:
registerRecordDeviceDriver.pl takes a long time to finish Hinko Kocevar
Re: registerRecordDeviceDriver.pl takes a long time to finish Johnson, Andrew N.

Navigate by Date:
Prev: Re: registerRecordDeviceDriver.pl takes a long time to finish Henrique Almeida
Next: Re: issue with epics in python Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: registerRecordDeviceDriver.pl takes a long time to finish Johnson, Andrew N.
Next: Re: registerRecordDeviceDriver.pl takes a long time to finish Luca Cavalli
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 28 Sep 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·