How fast is the FieldTrip buffer for realtime data streaming?

For real-time use of the buffer it is relevant to know how fast it can handle read and write requests. For a write request, the time depends on the number of channels and on the number of samples in the data block.

The following benchmarks have been run using the rt_benchmark script in the realtime directory on the following computers:

The first name in the legend always refers to the machine where the rt_benchmark script was run from, whereas the other name behind the dash refers to the machine that contained the buffer, with the exception of dma, which means that the buffer was kept in the same Matlab instance, thus involving no TCP/IP communication.

The dramatic dip for the mentat2xx-localhost connections needs further investigation.

Update 19-08-2010: After implementing an alternative communication channel using local UNIX domain sockets, here is an updated figure for a single 64-bit Linux machine. Communication over local domain sockets is generally faster, but most importantly, it is more consistent across blocksizes and scales linearly like the DMA throughput.

Older comparisons involving Apple computers

The benchmarking results presented in the table below were determined with the demo_buffer and the test_benchmark command-line executables, both present in the directory fieldtrip/realtime/buffer/test. Both applications were running on the same computer, i.e. using the local TCP stack. The blocksize below is the number of channels times the number of samples per block in each write request. The result is expressed in samples per second, and was measured over multiple seconds. Each sample is 4 bytes.