Open n-eiling opened 4 months ago
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: https://github.com/sogno-platform/dpsim/blob/966572994654625e5dfba5bdd076c9db1ae70b8b/dpsim-models/include/dpsim-models/Attribute.h#L355
We could use an arena allocator instead or avoid copying at this position.
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)
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: https://github.com/sogno-platform/dpsim/blob/966572994654625e5dfba5bdd076c9db1ae70b8b/dpsim-models/include/dpsim-models/Attribute.h#L355
We could use an arena allocator instead or avoid copying at this position.