[ https://issues.apache.org/jira/browse/KAFKA-1351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14102729#comment-14102729 ]
Viktor Taranenko commented on KAFKA-1351: ----------------------------------------- I was just comparing results in single thread using Kafka logging + Util.formatString (from patch): {code} debug(Utils.formatString("Alive partitions for topic %s are %s ", "topic", "partitions")) {code} Log4j2 {code} log.debug("Alive partitions for topic {} are {}", "topic", "partitions") {code} and the log.info() alternative While loggers were configured to only print INFO message into file ("logs/server.log") logging 1 billion messages with debug level took {noformat} Kafka: 4.960845 seconds Log4j2: 6.305278 {noformat} So Kafka was 20% more efficient in that case logging 10 million messages with info level: {noformat} Kafka: 57.440533 seconds Log4j2: 12.903711 seconds {noformat} > String.format is very expensive in Scala > ---------------------------------------- > > Key: KAFKA-1351 > URL: https://issues.apache.org/jira/browse/KAFKA-1351 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.7.2, 0.8.0, 0.8.1 > Reporter: Neha Narkhede > Labels: newbie > Fix For: 0.8.2 > > Attachments: KAFKA-1351.patch, KAFKA-1351_2014-04-07_18:02:18.patch, > KAFKA-1351_2014-04-09_15:40:11.patch > > > As found in KAFKA-1350, logging is causing significant overhead in the > performance of a Kafka server. There are several info statements that use > String.format which is particularly expensive. We should investigate adding > our own version of String.format that merely uses string concatenation under > the covers. -- This message was sent by Atlassian JIRA (v6.2#6252)