Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 9755 invoked from network); 3 May 2010 21:05:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 May 2010 21:05:21 -0000 Received: (qmail 15994 invoked by uid 500); 3 May 2010 21:05:21 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 15974 invoked by uid 500); 3 May 2010 21:05:21 -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 15966 invoked by uid 99); 3 May 2010 21:05:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 21:05:21 +0000 X-ASF-Spam-Status: No, hits=-1381.9 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 21:05:20 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o43L4x2S001902 for ; Mon, 3 May 2010 21:05:00 GMT Message-ID: <20596747.22731272920699868.JavaMail.jira@thor> Date: Mon, 3 May 2010 17:04:59 -0400 (EDT) From: "Nicolas Labrot (JIRA)" To: commits@cassandra.apache.org Subject: [jira] Commented: (CASSANDRA-1043) Faster UUID comparisons In-Reply-To: <26344418.9191272858715984.JavaMail.jira@thor> 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-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12863512#action_12863512 ] Nicolas Labrot commented on CASSANDRA-1043: ------------------------------------------- I will just add a comment on the test. Like the optimisation uses the internal structure of Jug UUID it should be valusable to add a test on it. for example with asserts on value of UUID.INDEX_CLOCK_HI, UUID.INDEX_CLOCK_MID and INDEX_CLOCK_MID.INDEX_CLOCK_LO > Faster UUID comparisons > ----------------------- > > Key: CASSANDRA-1043 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1043 > Project: Cassandra > Issue Type: Improvement > Components: Core > Reporter: James Golick > Assignee: James Golick > Priority: Minor > Fix For: 0.7 > > Attachments: faster-uuid-compare-v3.diff, faster_uuid_compare.diff, patch-v2-with-tests.diff > > > As I explained on the mailing list, doing slice queries on CFs that are sorted by TimeUUIDType gets slower as the value of count increases. According to my profiles, this is largely due to the fact that ConcurrentSkipListMap calls the comparator very frequently, which is extremely inefficient. In order to compare two UUIDs, it has to materialize them both in to java.util.UUID objects which is quite slow. The more UUIDs to compare, the slower it is. > Attached is a patch that compares UUIDs by extracting the timestamp directly from the byte[] representation. According to my tests, it's close to a 50% performance improvement. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.