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

Doug Cutting commented on AVRO-939:
-----------------------------------

Folks seem to only be running the benchmark after the change.  You need to 'svn 
revert src/main/java/org/apache/avro/io/BinaryData.java' and run it again to 
see what the performance is like without the change.  You might also try 
changing the LENGTH constant in Perf.java to 10 and to 1000 to see how that 
changes things.

Given the results I saw, unless we can make the new version much faster on 
shorter byte arrays we'd need to change things to only use the optimized 
version for longer arrays (> 100 bytes) so that performance is never slower.  
Even that's probably only worthwhile if performance on 64-bit systems is 
significantly better than the current implementation.
                
> Java: optimize BinaryData#compareBytes() to use sun.misc.Unsafe when available
> ------------------------------------------------------------------------------
>
>                 Key: AVRO-939
>                 URL: https://issues.apache.org/jira/browse/AVRO-939
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.7.1
>            Reporter: Doug Cutting
>         Attachments: AVRO-939-1.patch, AVRO-939-2.patch, AVRO-939-3.patch, 
> AVRO-939-4.patch, AVRO-939.patch
>
>
> Google's Guava libraries include an optimized implementation of lexicographic 
> byte comparison based on sun.misc.Unsafe that's ~4x faster than the normal 
> Java implementation.
> http://hiroshiyamauchi.blogspot.com/2010/08/fast-unsigned-byte-lexicographical.html
> http://www.google.com/codesearch#UKMs0lhE9bg/trunk/src/com/google/common/primitives/UnsignedBytes.java&l=276
> We might similarly optimize BinaryData#compareBytes().

--
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

        

Reply via email to