tillrohrmann commented on a change in pull request #14897: URL: https://github.com/apache/flink/pull/14897#discussion_r573531462
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/ResourceCounter.java ########## @@ -35,11 +37,12 @@ * associated counts. The counts are always positive (> 0). */ public final class ResourceCounter { Review comment: I don't think that microbenchmarks are very conclusive tbh. They usually neglect the fact that certain operations are not on the hot path and others are. I am not saying to revert these changes since you've done it but this is a good example for premature optimization which tries to optimize something which is not clear to be a problem. Mutability is always a problem in the sense that passing these objects around and then mutating it will cause other components to see these changes. Therefore, it is much safer to make objects immutable. Also you don't have to worry about concurrency and these kind of things. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org