sogno-platform/dpsim

Heap allocations in real time critical path lead to significant slow down

Opened this issue · 1 comments

We should avoid all heap allocations during the simulation as they lead to syscalls and context switches.

For example in a simple simulation involving the Villas interface ~30% of simulation time is spent on this line:

AttributeStatic<T>::make(this->get()));

We could use an arena allocator instead or avoid copying at this position.

stv0g commented

Do we really need to make allocations at all? Doesn't a fixed pre-allocated buffer could work too?

VILLASnode also comes with own allocator (struct Pool)