FlushEntityEvent are a major source of allocations, especially in scenarios with multiple entities being flushed as there’s a new event for each object needing stored. Performance analysis has shown that such event instances are unlikely to be optimised by the JVM, as they escape into non-trivial code paths. Some other events already have a “reuse” mechanism; I recall we avoided it for flush events because of concerns about recursive needs but we can still reuse them while ensuring we don’t reuse instance in case of recursion as this seems detectable. |