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

Gopal V commented on HADOOP-9601:
---------------------------------

The JNI calls were in-place to allow mixtures of direct/array buffers to be 
used (i.e checksums in one format & data in another).

But that doesn't look like a common scenario when I was testing this.

The exceptions can all be pulled out of the critical section, because they 
don't have particularly much to do with the data loops - all exceptions cause 
loop terminations, when we can release the objects and then throw.

I will move the cleanup to a macro and shove it in before every throw+return.

The GetPrimitiveArrayCritical chunking can be done easily within the loop, but 
would it need independent JNI calls to unlock the GC? And if it does, in the 
best case scenario that is choking the lock - but it won't stutter other 
threads when given a particularly large array (128 Mb from the block pool 
scanner?).
                
> 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
>         Attachments: HADOOP-9601-WIP-01.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

Reply via email to