[
https://issues.apache.org/jira/browse/AVRO-939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419540#comment-13419540
]
Scott Carey commented on AVRO-939:
----------------------------------
{quote}wait a minute, if you meant 32 bit kernel running 64 bit hotspot thats
still no good for a real 64 bit benchmark, is it?{quote}
It is fine. If the JVM says it is 64 bit, then it is getting the benefit of
the 64 bit registers and operations in user-space, which is what we need to
measure here.
{quote}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.{quote}
It looks like there are some opportunities to make this code faster. The
method seems large, breaking it up may help Hotspot since it profiles at the
method level and has more optimizations enabled for smaller methods. Using an
abstract class instead of interface might help. We may be able to reduce the
number of conditionals or present them to the JIT in a way that leads to better
profiling and optimization.
> 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