Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-5706

[Java] Remove type conversion in getValidityBufferValueCapacity

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.14.0
    • Component/s: Java

      Description

      Now implementation of getValidityBufferValueCapacity is:

      (int) (validityBuffer.capacity() * 8L)

      Seems no need to convert it to Long then convert it back to Int, just replace with:

      validityBuffer.capacity() * 8

      VariableWidthVectorBenchmarks#getValueCapacity shows the performance:

      Before:

      avgt 5 5.731 ± 0.160 ns/op

      After:

      avgt 5 5.124 ± 0.125 ns/op

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tianchen92 Ji Liu
                Reporter:
                tianchen92 Ji Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 10m
                  10m