The object has 6,7 fields.
cache.get()
is a map read.
Which one is faster?
obj temp = cache.get(key); // temporary object creation
Int id = temp != null ? temp.getId() : null;
or
Int id = cache.get(key) != null ? cache.get(key).getId() : null; // cache read twice
For Java with low latency, which of the above is better?