cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Allsopp (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (CASSANDRA-2850) Converting bytes to hex string is unnecessarily slow
Date Mon, 04 Jul 2011 21:49:21 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-2850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059622#comment-13059622
] 

David Allsopp edited comment on CASSANDRA-2850 at 7/4/11 9:48 PM:
------------------------------------------------------------------

Update - the benchmark version 3 was running v3 twice, not v3 then v4. Have re-attached. New
results are 15-19x faster for 20MB values, 13-14x faster for 1KB values.

20M old: 1435
20M new: 376
20M  v2: 405
20M  v3: 141
20M  v4: 93
20M old: 1265
20M new: 360
20M  v2: 234
20M  v3: 187
20M  v4: 78
20M old: 1233
20M new: 376
20M  v2: 452
20M  v3: 125
20M  v4: 63
----
old: 2184
new: 906
 v2: 577
 v3: 188
 v4: 172
----
old: 2215
new: 937
 v2: 593
 v3: 188
 v4: 156
----

      was (Author: dallsopp):
    Update - the benchmark version 3 was running v3 twice, not v3 then v4. Have re-attached.
New results are:

20M old: 1435
20M new: 376
20M  v2: 405
20M  v3: 141
20M  v4: 93
20M old: 1265
20M new: 360
20M  v2: 234
20M  v3: 187
20M  v4: 78
20M old: 1233
20M new: 376
20M  v2: 452
20M  v3: 125
20M  v4: 63
----
old: 2184
new: 906
 v2: 577
 v3: 188
 v4: 172
----
old: 2215
new: 937
 v2: 593
 v3: 188
 v4: 156
----
  
> 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
>            Priority: Minor
>             Fix For: 0.8.2
>
>         Attachments: 2850-v2.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

        

Mime
View raw message