Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-1676

DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.21.0
    • Fix Version/s: None
    • Component/s: balancer
    • Labels:

      Description

      In the file:

      ./hadoop-0.21.0/hdfs/src/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java line:1520

      In the while loop, DateFormat.getDateTimeInstance()is called in each iteration. We can cache the result by moving it outside the loop or adding a class member.

      This is similar to the Apache bug https://issues.apache.org/bugzilla/show_bug.cgi?id=48778

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Xiaoming Shi
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development