Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10129

Add RamUsageEstimator shallowSizeOf(long[]) overload that just calls sizeOf(long[])?

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • None
    • New

    Description

      See LUCENE-10128 for an example. The problem is there is only a sizeOf(long[]), so if the programmer uses shallowSizeOf instead of sizeOf then it falls back to shallowSizeOf(Object) which does a bunch of reflection.

      This is pretty crazy because it can create performance traps. Should we just add a shallowSizeOf(long[]) that calls sizeOf(long[]), so that things are fast? (same for other primitive arrays). It would solve the problem easily I think.

      Attachments

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              rcmuir Robert Muir
              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 - 1h
                  1h