3 ms·
Optimizing for latency is often counter-intuitive. Polling as an example may be an effective way to lower latency, e.g. Linux NAPI. Increasing buffer sizes ma
by clktmr 5y ago
Optimizing for latency is often counter-intuitive.
Polling as an example may be an effective way to lower latency, e.g. Linux NAPI.
Increasing buffer sizes may also decrease latency because data can be processed in bursts, see buffer starvation. But if data comes in at a higher rate than can be processed, buffers fill up and are horrible for latency.
- SV_BubbleTime 5y ago> Polling as an example may be an effective way to lower latency, I had to learn this lesson the hard way recently. An embedded system where I had to get data from a couple SPI controller’s RAM. Made a bit complicated ISR and listener system that woke up threads to do a deferred-interrupt… by the time it was all said and done with a fair bit of code, I wasn’t happy with it. I figured out that usually data would be available every 2ms and just wrote the read routine just to sleep every 2ms and attempt another read, I have it “hitting” 90% of the time and my avg latency is almost nothing. .7ms or so.