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

Groovy 4 runtime performance on average 2.4x slower than Groovy 3

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0.0-beta-1, 3.0.9
    • None
    • bytecode, performance
    • None
    • OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
      OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
      WIN10 (tests) / REL 8 (web application)
      IntelliJ 2021.2

    Description

      Groovy 4.0.0-beta-1 runtime performance in our framework is on average 2 to 3 times slower compared to using Groovy 3.0.9 (regular i.e. non-INDY)

      • Our complete framework and application code is completely written in Groovy, spread over multiple IntelliJ modules
        • mixed @CompileDynamic/@TypeChecked and @CompileStatic
        • No Java classes left in project, i.e. no cross compilation occurs
      • We build using IntelliJ 2021.2 Groovy build process, then run / deploy the compiled class files
        • We do not use a Groovy based DSL, nor do we execute Groovy scripts during execution
      • Performance degradation when using Groovy 4.0.0-beta-1 instead of Groovy 3.0.9 (non-INDY):
        • The performance of the largest of our web applications has dropped 3x (startup) / 2x (table refresh) respectively
          • Stack: Tomcat/Vaadin/Ebean plus framework generated SQL
        • Our test suite runs about 2.4 times as long as before (120 min when using G4, compared to about 50 min with G3)
          • JUnit 5
          • test suite also contains no scripts / dynamic code execution
          • Individual test performance varies: A small number of tests runs faster, but the majority is slower, with some extreme cases taking nearly 10x as long to finish
      • Using Groovy 3.0.9 INDY displays nearly identical performance degradation, so it seems that the use of invoke dynamic is somehow at fault

      Attachments

        1. groovy_3_0_9_gc.png
          69 kB
          mgroovy
        2. groovy_3_0_9_loop2.png
          144 kB
          mgroovy
        3. groovy_3_0_9_loop4.png
          144 kB
          mgroovy
        4. groovy_3_0_9_mem.png
          179 kB
          mgroovy
        5. groovy_4_0_0_b1_loop2.png
          119 kB
          mgroovy
        6. groovy_4_0_0_b1_loop4_gc.png
          72 kB
          mgroovy
        7. groovy_4_0_0_b1_loop4_mem.png
          185 kB
          mgroovy
        8. groovy_4_0_0_b1_loop4.png
          118 kB
          mgroovy
        9. groovysql_performance_groovy4_2_xx_yy_zzzz.groovy
          10 kB
          Daniel Sun
        10. loops.groovy
          0.1 kB
          Daniel Sun
        11. profile3.txt
          69 kB
          Daniel Sun
        12. profile4.txt
          69 kB
          Daniel Sun
        13. profile4d.txt
          68 kB
          Daniel Sun
        14. profile4-loops.txt
          117 kB
          Daniel Sun

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            emge mgroovy

            Dates

              Created:
              Updated:

              Slack

                Issue deployment