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

Guozhang Wang commented on KAFKA-1607:
--------------------------------------

Scala used lazy evaluation, and hence the argument should probably not be 
evaluated: KAFKA-1115.

That said, I think KAFKA-1351 will still benefit us by upgrading to the newer 
version of log4j.

> Use of String format method in debug statements
> -----------------------------------------------
>
>                 Key: KAFKA-1607
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1607
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8.1.1
>            Reporter: Marko Milenkovic
>            Priority: Minor
>
> Some classes in {{kafka.producer}} package use {{String.format}} which is 
> very slow operation. String.format is going to be evaluated even debug is not 
> enabled and it affects performance. 
> for example:
> * {{kafka.producer.BrokerPartitionInfo}} line 41
> {code}
> debug("Getting broker partition info for topic %s".format(topic))
> {code}
> * {{kafka.producer.async.DefaultEventHandler}} line 62
> {code}
>   debug("Handling %d events".format(events.size))
> {code}
> those lines are just an example, there are few more places where logs are 
> evaluated. Removing those debug statements from the code I got 3 times better 
> producer performance. 
> Can you please check 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to