3 ms·
Not an expert by any means but another way to look at "allocation free" algorithms is by looking at them as "statically allocated". They don't allocate any new
by jacoblambda 6y ago
Not an expert by any means but another way to look at "allocation free" algorithms is by looking at them as "statically allocated".
They don't allocate any new memory but they do perform operations on an input and write it to an output. At least in the embedded world this is how this is often done. Considering the overlap between embedded software and HFT, I'd imagine most of these algorithms are going to be something along the lines of "Take in a massive but fixed size block of read only data and output a fixed size result." You can have allocated memory but it needs to be allocated at startup and be able to be consistently reused without need for reallocation.
If you want super low latency, the last thing you want is a memory allocator blocking in the middle of your highly optimised algorithm. Instead you allocate everything ahead of time and just reuse the memory over and over again.
- realtalk_sp 6y agoExactly this. It's annoying but also not as intractable as it sounds. NASA has a similar requirement for mission critical software operating under strict constraints.