zipkin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-zipkin] anuraaga commented on a change in pull request #2582: Reuse char[] buffer when decoding hex fields.
Date Sat, 11 May 2019 07:06:22 GMT
anuraaga commented on a change in pull request #2582: Reuse char[] buffer when decoding hex
fields.
URL: https://github.com/apache/incubator-zipkin/pull/2582#discussion_r283085383
 
 

 ##########
 File path: zipkin/src/main/java/zipkin2/internal/Proto3Fields.java
 ##########
 @@ -164,6 +164,13 @@ final int readLengthPrefix(Buffer b) {
     static final char[] HEX_DIGITS =
       {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
 
+    // Reuse the buffer for decoding into hex since it's immediately copied into a String.
+    static final ThreadLocal<char[]> THIRTY_TWO_CHARS = new ThreadLocal<char[]>()
{
 
 Review comment:
   Sure - it might have something to do with classloader leaks which I'm not familiar with
since I've never used a shared servlet container ;)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message