Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9EBE57BBF for ; Mon, 18 Jul 2011 04:31:51 +0000 (UTC) Received: (qmail 47895 invoked by uid 500); 18 Jul 2011 04:31:48 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 47701 invoked by uid 500); 18 Jul 2011 04:31:29 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 47674 invoked by uid 99); 18 Jul 2011 04:31:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jul 2011 04:31:23 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jul 2011 04:31:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4A615849D2 for ; Mon, 18 Jul 2011 04:31:00 +0000 (UTC) Date: Mon, 18 Jul 2011 04:31:00 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: <1874680341.21761.1310963460300.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2124532481.862.1309710201869.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-2850) Converting bytes to hex string is unnecessarily slow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-2850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066780#comment-13066780 ] Jonathan Ellis commented on CASSANDRA-2850: ------------------------------------------- This doesn't apply to either 0.7 or 0.8 branches for me... {noformat} form:svn-0.7 jonathan$ patch -p1 < 2850-v4.patch patching file src/java/org/apache/cassandra/utils/ByteBufferUtil.java Hunk #1 FAILED at 20. Hunk #2 succeeded at 446 (offset -33 lines). 1 out of 2 hunks FAILED -- saving rejects to file src/java/org/apache/cassandra/utils/ByteBufferUtil.java.rej patching file src/java/org/apache/cassandra/utils/FBUtilities.java Hunk #1 FAILED at 19. Hunk #2 FAILED at 44. Hunk #3 FAILED at 61. Hunk #4 FAILED at 350. Hunk #5 FAILED at 651. 5 out of 5 hunks FAILED -- saving rejects to file src/java/org/apache/cassandra/utils/FBUtilities.java.rej {noformat} Can you rebase on top of 0.8 head? It's pretty much a non-issue for 0.7 anyway since it is never used on a client op path. > Converting bytes to hex string is unnecessarily slow > ---------------------------------------------------- > > Key: CASSANDRA-2850 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2850 > Project: Cassandra > Issue Type: Improvement > Components: Core > Affects Versions: 0.7.6, 0.8.1 > Reporter: David Allsopp > Assignee: David Allsopp > Priority: Minor > Fix For: 0.8.2 > > Attachments: 2850-v2.patch, 2850-v4.patch, BytesToHexBenchmark.java, BytesToHexBenchmark2.java, BytesToHexBenchmark3.java, cassandra-2850a.diff > > > ByteBufferUtil.bytesToHex() is unnecessarily slow - it doesn't pre-size the StringBuilder (so several re-sizes will be needed behind the scenes) and it makes quite a few method calls per byte. > (OK, this may be a premature optimisation, but I couldn't resist, and it's a small change) > Will attach patch shortly that speeds it up by about x3, plus benchmarking test. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira