Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-3274

MinorCompactor repeatedly toString()'s outputFile

    Details

      Description

      Noticed that MinorCompactor#call() repeatedly calls getOutputFile() which ultimately calls Path#toString() each time. This isn't very efficient since we're repeatedly calculating the same thing and creating a bunch of short-lived objects.

      The output file name isn't going to change mid-MinC so the MinorCompactor should keep a local referenced to the result from a single call to getOutputFile() and use that local variable each time.

        Activity

        Hide
        elserj Josh Elser added a comment -

        Compactor#call() does a similar thing and could benefit from the same improvement.

        Show
        elserj Josh Elser added a comment - Compactor#call() does a similar thing and could benefit from the same improvement.
        Hide
        elserj Josh Elser added a comment -

        Added trivial caching of string value instead of repeatedly recomputing.

        Show
        elserj Josh Elser added a comment - Added trivial caching of string value instead of repeatedly recomputing.

          People

          • Assignee:
            elserj Josh Elser
            Reporter:
            elserj Josh Elser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 0.5h
              0.5h

                Development