You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/29 05:03:20 UTC

[GitHub] merlimat opened a new pull request #1306: Minimize number of thread local instances in CRC32CDigestManager

merlimat opened a new pull request #1306: Minimize number of thread local instances in CRC32CDigestManager
URL: https://github.com/apache/bookkeeper/pull/1306
 
 
   CRC32CDigestManager uses thread local to store the current crc value (since the crc is computed on the headers and then on the payload). 
   
   One issue is that the thread local instances are per-ledger and are never cleaned up from the thread local storage. As new ledgers get used, we'd have more memory used there. 
   
   For digest we really need 1 single variable 
   
   Changes: 
    * Use Netty FastThreadLocal instead of JDK ThreadLocal
    * Made the thread local variable static, since one thread is computing the checksum for an entry of a given ledge, before moving to next entry.
    * Minimized thread local `.get()` access since it's more expensive than regular variable access.
    * Removed the usage of `isNewCrc` since initial value for crc32c (as well as crc32) is 0
    

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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