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

Optimize foreach style loops on arrays

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.2
    • Static compilation
    • None

    Description

      The static compiler should be able to optimize foreach style loops if the collection type is an array type:

      int[] arr = ...
      for(int x: arr) { ... }
      

      Currently it relies on an iterator, making it much slower than it could be.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: