You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Stevo Slavic (JIRA)" <ji...@apache.org> on 2014/08/21 16:12:11 UTC

[jira] [Commented] (KAFKA-1607) Use of String format method in debug statements

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

Stevo Slavic commented on KAFKA-1607:
-------------------------------------

Duplicate of KAFKA-1351 ?

> 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
>         Attachments: kafka_no_string_format.nps, kafka_string_format.nps
>
>
> 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)