DataDog / java-dogstatsd-client

Java statsd client library
MIT License
176 stars 102 forks source link

Fix Message.equals #194

Closed retronym closed 2 years ago

retronym commented 2 years ago

I noticed excessive CPU usage in HashMap lookups in StatsDAggregator. The stacks shows that the HashMap had devolved into a TreeMap which happens after frequent hash collisions. That got me looking at the implementations of hashCode/equals in the Message heirarchy and this seems a likely culprit.

retronym commented 2 years ago

These are the only two instances of String comparison with ==, according to the linter in IntelliJ.

vickenty commented 2 years ago

Thank you!