In a simplistic benchmark that I run (consisting of "do 1" and "select 1" queries, running in a loop against local server), NetBeans profiler (CPU, instrumentation, all classes) says this line in jdbc\internal\common\packet\commands\StreamedQueryPacket.java takes takes about half of the CPU time
Indeed, even if hexdump is not going to be output, MySQLProtocol.hexdump is still called, and it creates a hex string (in a rather expensive manner), and also concatenated this string with "Sending :". But the "Sending : hex" string is not going to be used, unless log level is set to FINEST. I'm able to increase the QPS by wide margin, just by removing this string, or by placing it under if (log.getLevel() == java.util.logging.Level.FINEST) condition.
In a simplistic benchmark that I run (consisting of "do 1" and "select 1" queries, running in a loop against local server), NetBeans profiler (CPU, instrumentation, all classes) says this line in jdbc\internal\common\packet\commands\StreamedQueryPacket.java takes takes about half of the CPU time
log.finest("Sending : " + MySQLProtocol.hexdump(byteHeader, 0));
Indeed, even if hexdump is not going to be output, MySQLProtocol.hexdump is still called, and it creates a hex string (in a rather expensive manner), and also concatenated this string with "Sending :". But the "Sending : hex" string is not going to be used, unless log level is set to FINEST. I'm able to increase the QPS by wide margin, just by removing this string, or by placing it under if (log.getLevel() == java.util.logging.Level.FINEST) condition.