FreeBuilder
FreeBuilder copied to clipboard
Evaluate optimizability of internal EnumSet
Allocating objects in hot loops can cause unwanted GC and memory pressure if the JVM cannot optimize them away with escape analysis. We use an EnumSet (to store which properties remain unset) versus bitwise operations for readability, but we could achieve similar readability by moving the bitwise logic into the generated Property enum, if there is any benefit.
This would have to be done with a microbenchmark library like https://github.com/alicep-org/benchmark