Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 94248615A for ; Sat, 2 Jul 2011 16:45:40 +0000 (UTC) Received: (qmail 42749 invoked by uid 500); 2 Jul 2011 16:45:38 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 42700 invoked by uid 500); 2 Jul 2011 16:45:37 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 42687 invoked by uid 99); 2 Jul 2011 16:45:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 16:45:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jeffpk@gmail.com designates 209.85.210.44 as permitted sender) Received: from [209.85.210.44] (HELO mail-pz0-f44.google.com) (209.85.210.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 16:45:30 +0000 Received: by pzk5 with SMTP id 5so5095319pzk.31 for ; Sat, 02 Jul 2011 09:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Ml6kuVdxfEy4PR5qYphFAS3VkKq5Bc7oO1H37aCkybw=; b=b1KsyJkQWbZd3tVUDj6VGmrYiXHzSNNDy1qrYknkAI8vFZ6O6Xf2lHqCSR8XqB05Ht LiY0DUaAEPKeS47NhPeLwLMsW4Xye2Wr7ELvcDqU2ogNnquSoqPVnZV9T0N12J5lUqY4 Ci2a65/CRYo1lXLp2WGu3tFhCHZGPX4fZ50r8= MIME-Version: 1.0 Received: by 10.68.46.65 with SMTP id t1mr5236138pbm.231.1309625108286; Sat, 02 Jul 2011 09:45:08 -0700 (PDT) Received: by 10.68.44.8 with HTTP; Sat, 2 Jul 2011 09:45:08 -0700 (PDT) In-Reply-To: References: Date: Sat, 2 Jul 2011 12:45:08 -0400 Message-ID: Subject: Re: faster ByteBuffer comparison From: Jeffrey Kesselman To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org GetLong has to get it a byte at a time still to support endianess. Id have to think about it, but what you really want is to get it all into a byte array and then process it in 64bits. AIR there are some new array recasting things in Java 5+. Ill need to go look at them more closely... On Fri, Jul 1, 2011 at 5:42 PM, Yang wrote: > I can see from profiling that a lot of the time in both reading and writing > are spend on ByteBuffer compare on the column names (for long rows with many > columns) > I looked at the ByteBufferUtil.unsignedCompareByteBuffer() , it's basically > the same structure as standard JVM ByteBuffer.compare() > looping over each byte doing a ByteBuffer.get() > is there a faster (probably hardware-based) compare ? I tried doing 8 bytes > at a time by doing getLong() and it actually seems slower > thanks > Yang -- It's always darkest just before you are eaten by a grue.