You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Dave Brosius (Created) (JIRA)" <ji...@apache.org> on 2012/02/07 08:01:00 UTC
[jira] [Created] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
[patch] don't duplicate ByteBuffers when hashing
------------------------------------------------
Key: CASSANDRA-3869
URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
Project: Cassandra
Issue Type: Improvement
Components: Core
Reporter: Dave Brosius
Attachments: dont_dup_bb_for_hash.diff
given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13202413#comment-13202413 ]
Jonathan Ellis commented on CASSANDRA-3869:
-------------------------------------------
Looks like you need a hasArray check or it will break on direct BBs.
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Attachments: dont_dup_bb_for_hash.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Dave Brosius (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Brosius updated CASSANDRA-3869:
------------------------------------
Attachment: dont_dup_bb_for_hash.diff
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Attachments: dont_dup_bb_for_hash.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Jonathan Ellis (Reopened) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Ellis reopened CASSANDRA-3869:
---------------------------------------
Assignee: Dave Brosius
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Assignee: Dave Brosius
> Fix For: 1.1
>
> Attachments: dont_dup_bb_for_hash.diff, dont_dup_bb_for_hash2.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13203617#comment-13203617 ]
Jonathan Ellis commented on CASSANDRA-3869:
-------------------------------------------
bq. messagedigest uses ByteBuffer.get for these
Right, it uses the "destructive" get which is why we need the duplication.
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Attachments: dont_dup_bb_for_hash.diff, dont_dup_bb_for_hash2.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Dave Brosius (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Brosius updated CASSANDRA-3869:
------------------------------------
Attachment: dont_dup_bb_for_hash2.diff
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Attachments: dont_dup_bb_for_hash.diff, dont_dup_bb_for_hash2.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Jonathan Ellis (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Ellis resolved CASSANDRA-3869.
---------------------------------------
Resolution: Fixed
Fix Version/s: 1.1
Reviewer: jbellis
committed v2; I think your first intuition was right that this is a hot path worth optimizing.
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Assignee: Dave Brosius
> Fix For: 1.1
>
> Attachments: dont_dup_bb_for_hash.diff, dont_dup_bb_for_hash2.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-3869) [patch] don't duplicate
ByteBuffers when hashing
Posted by "Dave Brosius (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13203282#comment-13203282 ]
Dave Brosius commented on CASSANDRA-3869:
-----------------------------------------
interesting.. i see messagedigest uses ByteBuffer.get for these. ok, thanks for the info. updated patch, altho i suppose this is starting loose value at this point, so closing.
> [patch] don't duplicate ByteBuffers when hashing
> ------------------------------------------------
>
> Key: CASSANDRA-3869
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3869
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Dave Brosius
> Attachments: dont_dup_bb_for_hash.diff, dont_dup_bb_for_hash2.diff
>
>
> given how often hashing of ByteBuffers occurs, don't duplicate the ByteBuffer when hashing. (trivial - as the byte array was never copied just the BB wrapper -- but still).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira