Groovy
  1. Groovy
  2. GROOVY-3951 Groovy 1.8 runtime performance improvements
  3. GROOVY-3342

Optimization done by groovy compiler by caching number constants does not cover closure classes

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.6-rc-1, 1.6-rc-2
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None

      Description

      From version 1.6.x onwards, groovy compiler caches the number constants to optimize the runtime performance. Currently it is done only for top-level classes and not for classes that get generated for closures.

      So, If I say

      def cl = {
                     1000.times{
                             def i = 10
                             println i
                     }
      }
      cl()
      

      Constants 10 and 1000 are not cached and Integer object for value 10 gets created 1000 times. Optimization done for top-level classes is needed even for inner classes that get generated for closures.

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12970185 ] Default workflow, editable Closed status [ 12977964 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12732337 ] Default workflow, editable Closed status [ 12744172 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Jochen Theodorou made changes -
        Assignee Jochen Theodorou [ blackdrag ]
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]
        Jochen Theodorou made changes -
        Fix Version/s 1.7.X [ 15538 ]
        Jochen Theodorou made changes -
        Issue Type Improvement [ 4 ] Sub-task [ 7 ]
        Parent GROOVY-3951 [ 103036 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-x [ 15538 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Jochen Theodorou made changes -
        Field Original Value New Value
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Roshan Dawrani created issue -

          People

          • Assignee:
            Jochen Theodorou
            Reporter:
            Roshan Dawrani
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development