hibernate/hibernate-ogm — pull request #43 by Sanne (2011-12-01 10:17:32+00:00)
Title: OGM-113

This is another set of performance improving changes, focusing on memory consumption and excessive GC work this time.

It seems I have evidence against usage of fluent APIs on hot paths:
org.hibernate.ogm.grid.EntityKey is by far the most frequently and expensive object created, taking about 30% of total memory if we include uncollected references (so to to express the work the GC has to perform).

The problem is not that much the EntityKey itself as I don't think we can avoid creating them, but the EntityKeyBuilder is doubling this amount; I would have expected hotspot to be smarter about it and "see" it's just a helper to create the main key, but even after 2h stress test this pattern doesn't change, so I propose to remove the builder converting it into a static helper; this change reduced GC activity while running TPCW.