Skip to content

Collections Empty Map Defeats JIT Scalar Replacement for AbstractCompositeMeter #6811

@belugabehr

Description

@belugabehr

The CompositeCounter stores its 'children' in an IdentityHashMap. Consider using a different data structure, or if necessary, two data structures for this use case.

I am working on a high-performance application with many updates to the counters. From a recent Java Flight Recording, I noted that my application had generated 50GB on heap of Iterators from this class during a test run. Consider keeping an ArrayList of children (in addition to / instead of) a Map such that accessing the Collection of children becomes a heap-free operation.

for (Counter c : getChildren()) {
c.increment(amount);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for teamAn issue we need members of the team to review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions