Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11466

FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.1, 3.0.0-alpha1
    • Component/s: io, performance, util
    • Labels:
    • Environment:

      Linux X86 and Solaris SPARC

    • Target Version/s:

      Description

      One difference between Hadoop 2.x and Hadoop 1.x is a utility to compare two byte arrays at coarser 8-byte granularity instead of at the byte-level. The discussion at HADOOP-7761 says this fast byte comparison is somewhat faster for longer arrays and somewhat slower for smaller arrays ( AVRO-939). In order to do 8-byte reads on addresses not aligned to 8-byte boundaries, the patch uses Unsafe.getLong. The problem is that this call is incredibly expensive on SPARC. The reason is that the Studio compiler detects an unaligned pointer read and handles this read in software. x86 supports unaligned reads, so there is no penalty for this call on x86.

        Issue Links

          Activity

          Hide
          sumansomasundar Suman Somasundar added a comment -

          Check for the architecture of the system. If it is SPARC, return old style comparer, else return the new fast byte comparer.

          Show
          sumansomasundar Suman Somasundar added a comment - Check for the architecture of the system. If it is SPARC, return old style comparer, else return the new fast byte comparer.
          Hide
          cmccabe Colin P. McCabe added a comment -

          Thanks, Suman. Can you add a LOG.trace in both cases so that we can turn up the log level when needed to get some logs?

          Show
          cmccabe Colin P. McCabe added a comment - Thanks, Suman. Can you add a LOG.trace in both cases so that we can turn up the log level when needed to get some logs?
          Hide
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12691999/HADOOP-11466.001.patch
          against trunk revision 10ac5ab.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5394//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5394//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12691999/HADOOP-11466.001.patch against trunk revision 10ac5ab. +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5394//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5394//console This message is automatically generated.
          Hide
          cmccabe Colin P. McCabe added a comment -

          I thought about this some more, and I think instead of "whitelisting" the architectures that should use UNSAFE_COMPARER_NAME, we should "blacklist" the architectures that should not use it. This seems more robust since architectures like ARM now support unaligned access (in their later revisions). Also, x86 has gone by many names over its lifetime, and I'm a little nervous that we might not have caught all of them. Yeah, there's i386, x86, and x86_64, but is anyone returning x686, i386, etc. any more? I think let's special-case SPARC, not x86.

          Thanks, Suman.

          Show
          cmccabe Colin P. McCabe added a comment - I thought about this some more, and I think instead of "whitelisting" the architectures that should use UNSAFE_COMPARER_NAME, we should "blacklist" the architectures that should not use it. This seems more robust since architectures like ARM now support unaligned access (in their later revisions). Also, x86 has gone by many names over its lifetime, and I'm a little nervous that we might not have caught all of them. Yeah, there's i386, x86, and x86_64, but is anyone returning x686, i386, etc. any more? I think let's special-case SPARC, not x86. Thanks, Suman.
          Hide
          sumansomasundar Suman Somasundar added a comment -

          I have made the changes.

          Thanks.

          Show
          sumansomasundar Suman Somasundar added a comment - I have made the changes. Thanks.
          Hide
          cmccabe Colin P. McCabe added a comment -

          Can you add a message logging the exception in the " } catch (Throwable t) { // ensure we really catch everything" block?

          +1 when that's resolved. sorry for the delays in reviews

          Show
          cmccabe Colin P. McCabe added a comment - Can you add a message logging the exception in the " } catch (Throwable t) { // ensure we really catch everything " block? +1 when that's resolved. sorry for the delays in reviews
          Hide
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12693678/HADOOP-11466.003.patch
          against trunk revision 925c9fe.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5444//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5444//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12693678/HADOOP-11466.003.patch against trunk revision 925c9fe. +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5444//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5444//console This message is automatically generated.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-trunk-Commit #6909 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6909/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #6909 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6909/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #81 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/81/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #81 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/81/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #815 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/815/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #815 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/815/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk #2013 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2013/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2013 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2013/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #78 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/78/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #78 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/78/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #82 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/82/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #82 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/82/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2032 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2032/)
          HADOOP-11466. FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2032 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2032/ ) HADOOP-11466 . FastByteComparisons: do not use UNSAFE_COMPARER on the SPARC architecture because it is slower there (Suman Somasundar via Colin P. McCabe) (cmccabe: rev ee7d22e90ce67de3e7ee92f309c048a1d4be0bbe) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java
          Hide
          cmccabe Colin P. McCabe added a comment -

          Backported to 2.6.1. This is a really small fix.

          Show
          cmccabe Colin P. McCabe added a comment - Backported to 2.6.1. This is a really small fix.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #6934 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6934/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #6934 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6934/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          sumansomasundar Suman Somasundar added a comment -

          How do i find out the cause of this failure?

          Show
          sumansomasundar Suman Somasundar added a comment - How do i find out the cause of this failure?
          Hide
          stevel@apache.org Steve Loughran added a comment -

          Ignore the "failure"; it's jenkins often assesses merges this way, even though they aren't. The patch is in.

          Show
          stevel@apache.org Steve Loughran added a comment - Ignore the "failure"; it's jenkins often assesses merges this way, even though they aren't. The patch is in.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #86 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/86/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #86 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/86/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #820 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/820/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #820 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/820/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #83 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/83/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #83 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/83/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2037 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2037/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2037 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2037/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk #2018 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2018/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #2018 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2018/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #87 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/87/)
          HADOOP-11466: move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #87 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/87/ ) HADOOP-11466 : move to 2.6.1 (cmccabe: rev 21d5599067adf14d589732a586c3b10aeb0936e9) hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          vinodkv Vinod Kumar Vavilapalli added a comment -

          Closing old tickets that are already shipped in a release.

          Show
          vinodkv Vinod Kumar Vavilapalli added a comment - Closing old tickets that are already shipped in a release.

            People

            • Assignee:
              sumansomasundar Suman Somasundar
              Reporter:
              sumansomasundar Suman Somasundar
            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development