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

[Java] Avoid string concatenation when calling Preconditions#checkArgument

    XMLWordPrintableJSON

Details

    Description

      Preconditions#checkArgument is called in VectorLoader with the String message already built.

      This causes some noticeable overhead as can be seen from the attached flame graphs.

       

      Calling checkArgument with an error template instead avoids the call to StringBuilder as can be seen in the after image.

      Attachments

        1. after.png
          6 kB
          stephane campinas
        2. before.png
          10 kB
          stephane campinas

        Issue Links

          Activity

            People

              yfful stephane campinas
              yfful stephane campinas
              Votes:
              0 Vote for this issue
              Watchers:
              4 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