As part of the fsp subsystem design we're likely going to want to implement some shared memory systems for low latency multi-time frame calcs. I've started a couple design ideas about this in #98 but I do think for sure part of this system will require a fast ring buffer for numpy data:
Here's a starter list of projects to try after some very brief searching
2020: ringbuf looks to be built for real-time audio but is single producer/consumer (which is actually fine for our use case afaik) but is built as a cython wrapper around boost (ala C++) libs; numpyexample looks good
2021: redo of ringbuf in rust targeting some missing features with ctypes wrapping/integration for python
2020: circular_buffer_numpy seems kinda like a simple wrapper around an array with "pointer" index references kinda like what i've rolled many times before.
a random walk plot using none other then the great pyqtgraph and a numpy using np.roll().
It may just end up we take a lang from #106 and implement one or try out some designs from above on the new SharedMemory type which has an example using a numpy array. An example wrapper for an older version of this from the scipy cookbooks is here.
disruptor style
The "lurkers" said LMAX already did this best with their disruptor project. I think we can make a very cool variant of this with actors, numpy and numba:
As part of the fsp subsystem design we're likely going to want to implement some shared memory systems for low latency multi-time frame calcs. I've started a couple design ideas about this in #98 but I do think for sure part of this system will require a fast ring buffer for
numpy
data:Here's a starter list of projects to try after some very brief searching
committed to long ago
numpy
pyringbuf
a c-ext implementing a character buffercommitted recently
pyring
pure python impl and has a multi-proc c-types exampleringbuf
looks to be built for real-time audio but is single producer/consumer (which is actually fine for our use case afaik) but is built as a cython wrapper aroundboost
(ala C++) libs;numpy
example looks goodringbuf
in rust targeting some missing features withctypes
wrapping/integration for python2020: circular_buffer_numpy seems kinda like a simple wrapper around an array with "pointer" index references kinda like what i've rolled many times before.
futher resources
scipy
mailing list discussion from 09'pyqtgraph
and anumpy
usingnp.roll()
.It may just end up we take a lang from #106 and implement one or try out some designs from above on the new
SharedMemory
type which has an example using anumpy
array. An example wrapper for an older version of this from the scipy cookbooks is here.disruptor style
The "lurkers" said LMAX already did this best with their
disruptor
project. I think we can make a very cool variant of this with actors,numpy
andnumba
:disruptor
link :surfer:numpy
support at all).As always, lurkers please chime.