[ 
https://issues.apache.org/jira/browse/KAFKA-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15029495#comment-15029495
 ] 

ASF GitHub Bot commented on KAFKA-2882:
---------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/kafka/pull/580


> Add constructor cache for Snappy and LZ4 Output/Input stream in 
> Compressor.java
> -------------------------------------------------------------------------------
>
>                 Key: KAFKA-2882
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2882
>             Project: Kafka
>          Issue Type: Improvement
>          Components: consumer, producer 
>    Affects Versions: 0.8.2.1
>            Reporter: Maksim Logvinenko
>            Assignee: Neha Narkhede
>             Fix For: 0.9.0.1
>
>
> In `wrapForOutput` and `wrapForInput` methods of 
> `org.apache.kafka.common.record.Compressor`,  `Class.forName("[compression 
> codec]")` and `getConstructor` methods are invoked for each `wrapForOutput` / 
> `wrapForInput` call. Reflection calls are expensive and impact performance at 
> high volumes. This patch adds a cache for `Constructor` to reduce the 
> reflection overhead.
> In our production deployments, this has reduced producer CPU usage by about 
> 20%



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to