You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Folke Behrens (JIRA)" <ji...@apache.org> on 2010/08/12 22:28:17 UTC

[jira] Updated: (CASSANDRA-1043) Faster UUID comparisons

     [ https://issues.apache.org/jira/browse/CASSANDRA-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Folke Behrens updated CASSANDRA-1043:
-------------------------------------

    Attachment: timestamp-byte-order-comparison.patch.txt

Attached patch makes TimeUUIDType compare the timestamp bytes directly in the right order. Note that FBUtilities.compareByteArrays([B[B) does deliberately not call its sibling to preserve compatibility.

> 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 beta 1
>
>         Attachments: faster-uuid-compare-v3.diff, faster_uuid_compare.diff, patch-v2-with-tests.diff, timestamp-byte-order-comparison.patch.txt
>
>
> 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.