hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-10674) Rewrite the PureJavaCrc32 loop for performance improvement
Date Tue, 24 Jun 2014 22:16:26 GMT

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

Jing Zhao commented on HADOOP-10674:
------------------------------------

It will be better to change the following code
{code}
+    for(final int end = offset + len - remainder; i < end; i += 8) {
+      final int x = localCrc
+          ^ (((b[i  ] << 24) >>> 24) + ((b[i+1] << 24) >>>
16))
+          + (((b[i+2] << 24) >>> 8 ) +  (b[i+3] << 24));
{code}

to

{code}
+    for(final int end = offset + len - remainder; i < end; i += 8) {
+      final int x = localCrc
+          ^ (((b[i  ] << 24) >>> 24) + ((b[i+1] << 24) >>>
16))
+          +  ((b[i+2] << 24) >>> 8 ) +  (b[i+3] << 24)));
{code}

Other than that +1.

> Rewrite the PureJavaCrc32 loop for performance improvement
> ----------------------------------------------------------
>
>                 Key: HADOOP-10674
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10674
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: performance, util
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>         Attachments: c10674_20140609.patch, c10674_20140609b.patch, c10674_20140610.patch,
c10674_20140612.patch, c10674_20140619.patch
>
>
> Below are some performance improvement opportunities performance improvement in PureJavaCrc32.
> - eliminate "off += 8; len -= 8;"
> - replace T8_x_start with hard coded constants
> - eliminate c0 - c7 local variables
> In my machine, there are 30% to 50% improvement for most of the cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message