Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7178

Reduce memory consumption of respondsTo

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.0-beta-4
    • None

    Description

      The code in MetaClassImpl creates an ArrayList where we know it will only return a list of a single element. Using Collections.singletonList would reduce the memory pressure, as well as Collections.emptyList() if the list is empty.

      Putting a "breaking" label because potentially one could rely on the fact that respondsTo returns a mutable list, even though improbable.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: