EPICS Controls 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  <20102011  2012  2013  2014  2015  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  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: StreamDevice slowdown
From: Dirk Zimoch <[email protected]>
To: "[email protected] tech-talk" <[email protected]>
Date: Mon, 27 Sep 2010 10:33:59 +0200
Hi all,

As I already told Eric, I suspect a problem with buffer growth. I start with a 64 byte buffer that doubles each time it overflows. At each re-alloc the already read input is copied to the new buffer. This leads to the O(n²) behavior.

I will test this theory and try to fix it.

Dirk

Eric Norum wrote:
I'm encountering unexpected behaviour from ASYN/StreamDevice. Data transfer gets slower and slower as a transaction proceeds.

Here's the waveform record that I'm trying to fill:
record(waveform, "$(P)capture")
{
    field(DESC, "Read out ADC capture buffer")
    field(DTYP, "stream")
    field(INP,  "@devtfb.proto capture $(PORT) 0")
    field(FTVL, "SHORT")
    field(NELM, 16777216)
}

And here's the StreamDevice protocol:
capture {
    InTerminator = "\xA5\x5A";
    out "Waveform?";
    in "%2r";
    ExtraInput = Ignore;
}



I added some diagnostics to the sending instrument to report the time after each 2^20 samples have been sent:

Here's how things progress.

The first 2^20 samples take 16.78 seconds to transfer from the instrument to the IOC.
The next 2^20 samples take 48.18 seconds.
The next 2^20 samples take 80.91 seconds.
The next 2^20 samples take 113.86 seconds.
The next 2^20 samples take 147.28 seconds.


This seems very strange. Each block of 2^20 samples takes about 32 seconds longer to transfer than the previous. It looks like there's some sort of 'strlen()' kind of operation happening that's taking longer and longer as the waveform contents fill.


Is this fixable?


References:
StreamDevice slowdown Eric Norum

Navigate by Date:
Prev: RE: ImageMagick tom.cobb
Next: RE: always more inputs in gensub/asub nick.rees
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: StreamDevice slowdown Eric Norum
Next: error compiling base R3-14-11 gabriele marano
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 28 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·