You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/11/25 10:33:35 UTC

[GitHub] [kafka] mimaison commented on a diff in pull request #12890: KAFKA-14414: Remove unnecessary usage of ObjectSerializationCache

mimaison commented on code in PR #12890:
URL: https://github.com/apache/kafka/pull/12890#discussion_r1032261055


##########
clients/src/main/java/org/apache/kafka/common/requests/RequestHeader.java:
##########
@@ -75,7 +77,17 @@ public void write(ByteBuffer buffer, ObjectSerializationCache serializationCache
     }
 
     public int size(ObjectSerializationCache serializationCache) {
-        return data.size(serializationCache, headerVersion);
+        if (this.size == SIZE_NOT_INITIALIZED) {

Review Comment:
   I think this method does not need to be public anymore, callers from other packages use the new overload. 
   Also on the golden path `size() -> size(ObjectSerializationCache serializationCache)` we do the equality check twice. If we inline it, does it make a difference? 



-- 
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.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org