You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2013/07/10 01:53:48 UTC

[jira] [Commented] (HADOOP-9601) Support native CRC on byte arrays

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

Colin Patrick McCabe commented on HADOOP-9601:
----------------------------------------------

Thanks for taking this on, Gopal.

{code}
+#define RELEASE_ARRAYS() do {\
+#define GET_ARRAYS() do {\
{code}

I don't think these should be macros.  They really should be static functions.

{code}
+      long t2 = System.currentTimeMillis();
+      long mb = ((long)i*dataLength)/(1024*1024);
+      System.out.printf("Checksum verify %s+%s: %d MB took %d ms (%2.2f MB/s)\n", type.toString(), direct ? "direct" : "array", mb, (t2 - t1), (1000.0*mb)/(t2 - t1));      
{code}

I realize this is a little bit pedantic, but can we avoid the divide-by-zero in this test program when t2==t1?
                
> Support native CRC on byte arrays
> ---------------------------------
>
>                 Key: HADOOP-9601
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9601
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: performance, util
>    Affects Versions: 3.0.0
>            Reporter: Todd Lipcon
>            Assignee: Gopal V
>              Labels: perfomance
>         Attachments: HADOOP-9601-bench.patch, HADOOP-9601-rebase+benchmark.patch, HADOOP-9601-trunk-rebase-2.patch, HADOOP-9601-trunk-rebase.patch, HADOOP-9601-WIP-01.patch, HADOOP-9601-WIP-02.patch
>
>
> When we first implemented the Native CRC code, we only did so for direct byte buffers, because these correspond directly to native heap memory and thus make it easy to access via JNI. We'd generally assumed that accessing byte[] arrays from JNI was not efficient enough, but now that I know more about JNI I don't think that's true -- we just need to make sure that the critical sections where we lock the buffers are short.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira