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?