Context: I use netty and defined a handler to count and classify inbound / outbound traffic. For this, I used enumMap, which looks like this:
EnumMap<MyEnum, AtomicLong>
However, now I realized that there is only one thread that manipulates the values ββ(previously I thought it was more than one, netty seems to guarantee that there is one thread per channel). This means that AtomicLong is not required. However, since AtomicLong is a wrapper for a primitive long time, Long Long is an immutable type, I have reason to think that simply replacing AtomicLong with Long will be less efficient.
Any ideas on this?
What I probably should do is go to int and delete the entire enumMap entry.
BR Sebastian
source share