Closed k-raval closed 10 months ago
Thanks for reporting. I'm always happy to improve perf bottlenecks. I'll give it a shot.
Thanks qmuntal for quick response and quick fix as well.
Your fix is working as expected. Now the 'findHandler' function is not in the top allocator list.
As soon as you merge and create a new release tag, we will be able to take it in.
Hi,
We are extensively using this FSM library in our codebase and thanks for the same.
While profiling the code, we found that the findHandler function allocates lot of objects on heap and which later get recycled by garbage collector, however that takes CPU cycles and affects the overall performance.
I think for each trigger, all the possible behaviours are known during configuration (i.e. call to Configure/PermitDynamic/....). So can we not populate what is required once and use it every time during findHandler.
The other two slices (metResults, unmetResults) can also be pre-allocated/pre-populated during configuration.
Let us know as it will save a lot of memory allocations and thereby improve performance.
Thanks.