Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-595

Optimize Decimal64 scale calculation

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.7.0
    • 1.7.0
    • encoding
    • None
    • Important

    Description

      Currently Decimal64 is using an inner loop to apply the correct scale to each read Long value https://github.com/apache/orc/blob/master/java/core/src/java/org/apache/orc/impl/TreeReaderFactory.java#L1294

      A more efficient way would be to apply the scale using a single array access and by multiplying by 10 in the power of (scale - scratchScaleVector[r]).

      An extra optimization would be to keep all powers of 10 (up to 18) in a static array and reuse it across runtime instead of calculating each time.

      cc: Ramesh Kumar Thangarajan Gopal Vijayaraghavan

      Attachments

        1. DecimalBench-Clean-scale2.log
          5 kB
          Panagiotis Garefalakis
        2. DecimalBench-ORC-595-scale2.log
          5 kB
          Panagiotis Garefalakis
        3. Profile-ORC-595-patch.png
          74 kB
          Panagiotis Garefalakis
        4. Profile-ORC-595-clean.png
          97 kB
          Panagiotis Garefalakis
        5. DecimalBenchPerf-Clean.log
          52 kB
          Panagiotis Garefalakis
        6. DecimalBenchPerf-ORC-595.log
          76 kB
          Panagiotis Garefalakis

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            pgaref Panagiotis Garefalakis
            pgaref Panagiotis Garefalakis
            Votes:
            0 Vote for this issue
            Watchers:
            3 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 - 20m
                20m

                Slack

                  Issue deployment