zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] zookeeper pull request #684: ZOOKEEPER-3180: Add response cache to improve t...
Date Tue, 04 Dec 2018 18:57:23 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/684#discussion_r238787735
  
    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/DumbWatcher.java
---
    @@ -69,7 +69,7 @@ public void sendCloseSession() { }
         void setSessionId(long sessionId) { }
     
         @Override
    -    void sendBuffer(ByteBuffer closeConn) { }
    +    void sendBuffer(ByteBuffer... closeConn) { }
    --- End diff --
    
    In order to reduce the GC effort by re-using the cached serialized data, we need to break
the single response packet into different part, the length buffer, the header buffer, and
the data buffer, length and header will be built every time, but data buffer is reused, that's
why we changed this to pass in a buffers list.


---

Mime
View raw message