Spring Roo
  1. Spring Roo
  2. ROO-1045

Big performance problems with roo shell

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1.0.M1
    • Fix Version/s: 1.1.0.M2
    • Component/s: @ CORE
    • Labels:
      None
    • Environment:
      Windows 7 and Linux Ubuntu 9.1
      Using Roo shell within STS and from command line

      Description

      Having a project with about 90 entities (not big ones), integration tests and controllers make roo shell hang up for about 20-40 minutes when starting, with the CPU at 100%.

      I have created a basic roo script creating 100 entities with only 5 fields in each and without any relations. It also creates the controllers and the integration tests.

      After the script is done, just exit roo and start the shell again and it start consuming CPU and hanging. Just type 'hint' and it's only when you get the prompt back that roo becomes enable. Then, when you do some manual changes in entities, roo has really some trouble identifying and applying changes.

      We have decided to use roo to develop our new application, but if this issue can't be resolved (or at lease have a workaround), we'll have to continue without roo.

      1. gen_100.roo
        29 kB
        Marc Pancheri

        Activity

        Hide
        Marc Pancheri added a comment -

        Under Linux, you have to run "ulimit -n 10000" to avoid the "too many open files" error message when running the gen_100.roo script.

        Show
        Marc Pancheri added a comment - Under Linux, you have to run "ulimit -n 10000" to avoid the "too many open files" error message when running the gen_100.roo script.
        Hide
        Robert Oschwald added a comment -

        Same problem here with 14 Entities, each with approx. 20 fields.

        Show
        Robert Oschwald added a comment - Same problem here with 14 Entities, each with approx. 20 fields.
        Hide
        Ben Alex added a comment - - edited

        Fixed in Git commit cb8b34f136cf12d7a8463ad6dea106382d2b3b93.

        I ended up taking your script as far as creating the first 5 entities then exiting Roo. When a Roo was executed with the "metadata status" command via the operating system command line, it shows how long Roo takes to start up and where that time was spent:

        62: org.springframework.roo.addon.finder.FinderMetadata
        108: org.springframework.roo.addon.configurable.ConfigurableMetadata
        121: org.springframework.roo.addon.dod.DataOnDemandMetadata
        150: org.springframework.roo.addon.javabean.JavaBeanMetadata
        164: org.springframework.roo.addon.test.IntegrationTestMetadata
        176: org.springframework.roo.addon.tostring.ToStringMetadata
        205: org.springframework.roo.addon.beaninfo.BeanInfoMetadata
        360: org.springframework.roo.addon.plural.PluralMetadata
        489: org.springframework.roo.process.manager.internal.DefaultFileManager
        Startup exec 4632 ms

        After adding the web controllers via "controller all", the new startup time statistics:

        61: org.springframework.roo.addon.javabean.JavaBeanMetadata
        100: org.springframework.roo.addon.configurable.ConfigurableMetadata
        243: org.springframework.roo.addon.entity.EntityMetadata
        279: org.springframework.roo.addon.tostring.ToStringMetadata
        513: org.springframework.roo.addon.test.IntegrationTestMetadata
        531: org.springframework.roo.addon.finder.FinderMetadata
        543: org.springframework.roo.addon.dod.DataOnDemandMetadata
        768: org.springframework.roo.addon.plural.PluralMetadata
        781: org.springframework.roo.addon.beaninfo.BeanInfoMetadata
        920: org.springframework.roo.process.manager.internal.DefaultFileManager
        4750: org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadata
        7348: org.springframework.roo.addon.web.mvc.jsp.JspMetadata
        Startup exec 19694 ms

        I made some adjustments to the way OSGi components are registered. The results follow.

        Without web controllers:

        2: org.springframework.roo.addon.finder.FinderMetadata
        9: org.springframework.roo.addon.tostring.ToStringMetadata
        10: org.springframework.roo.addon.configurable.ConfigurableMetadata
        22: org.springframework.roo.addon.dod.DataOnDemandMetadata
        55: org.springframework.roo.addon.test.IntegrationTestMetadata
        66: org.springframework.roo.addon.plural.PluralMetadata
        70: org.springframework.roo.addon.beaninfo.BeanInfoMetadata
        98: org.springframework.roo.addon.javabean.JavaBeanMetadata
        170: org.springframework.roo.process.manager.internal.DefaultFileManager
        Startup exec 3112 ms

        With the "controller all" controllers:

        4: org.springframework.roo.addon.configurable.ConfigurableMetadata
        7: org.springframework.roo.addon.javabean.JavaBeanMetadata
        9: org.springframework.roo.addon.tostring.ToStringMetadata
        11: org.springframework.roo.addon.dod.DataOnDemandMetadata
        25: org.springframework.roo.addon.test.IntegrationTestMetadata
        26: org.springframework.roo.addon.entity.EntityMetadata
        37: org.springframework.roo.addon.finder.FinderMetadata
        66: org.springframework.roo.addon.beaninfo.BeanInfoMetadata
        147: org.springframework.roo.addon.plural.PluralMetadata
        239: org.springframework.roo.process.manager.internal.DefaultFileManager
        367: org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadata
        3063: org.springframework.roo.addon.web.mvc.jsp.JspMetadata
        Startup exec 6631 ms

        As such the net result is:

        • Without controllers: 4632 vs 3112 (1.5 times faster)
        • With controllers: 19694 vs 6631 (2.9 times faster)

        Stefan is going to have a look in the JspMetadata to see what we can do to speed it up as well.

        Show
        Ben Alex added a comment - - edited Fixed in Git commit cb8b34f136cf12d7a8463ad6dea106382d2b3b93. I ended up taking your script as far as creating the first 5 entities then exiting Roo. When a Roo was executed with the "metadata status" command via the operating system command line, it shows how long Roo takes to start up and where that time was spent: 62: org.springframework.roo.addon.finder.FinderMetadata 108: org.springframework.roo.addon.configurable.ConfigurableMetadata 121: org.springframework.roo.addon.dod.DataOnDemandMetadata 150: org.springframework.roo.addon.javabean.JavaBeanMetadata 164: org.springframework.roo.addon.test.IntegrationTestMetadata 176: org.springframework.roo.addon.tostring.ToStringMetadata 205: org.springframework.roo.addon.beaninfo.BeanInfoMetadata 360: org.springframework.roo.addon.plural.PluralMetadata 489: org.springframework.roo.process.manager.internal.DefaultFileManager Startup exec 4632 ms After adding the web controllers via "controller all", the new startup time statistics: 61: org.springframework.roo.addon.javabean.JavaBeanMetadata 100: org.springframework.roo.addon.configurable.ConfigurableMetadata 243: org.springframework.roo.addon.entity.EntityMetadata 279: org.springframework.roo.addon.tostring.ToStringMetadata 513: org.springframework.roo.addon.test.IntegrationTestMetadata 531: org.springframework.roo.addon.finder.FinderMetadata 543: org.springframework.roo.addon.dod.DataOnDemandMetadata 768: org.springframework.roo.addon.plural.PluralMetadata 781: org.springframework.roo.addon.beaninfo.BeanInfoMetadata 920: org.springframework.roo.process.manager.internal.DefaultFileManager 4750: org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadata 7348: org.springframework.roo.addon.web.mvc.jsp.JspMetadata Startup exec 19694 ms I made some adjustments to the way OSGi components are registered. The results follow. Without web controllers: 2: org.springframework.roo.addon.finder.FinderMetadata 9: org.springframework.roo.addon.tostring.ToStringMetadata 10: org.springframework.roo.addon.configurable.ConfigurableMetadata 22: org.springframework.roo.addon.dod.DataOnDemandMetadata 55: org.springframework.roo.addon.test.IntegrationTestMetadata 66: org.springframework.roo.addon.plural.PluralMetadata 70: org.springframework.roo.addon.beaninfo.BeanInfoMetadata 98: org.springframework.roo.addon.javabean.JavaBeanMetadata 170: org.springframework.roo.process.manager.internal.DefaultFileManager Startup exec 3112 ms With the "controller all" controllers: 4: org.springframework.roo.addon.configurable.ConfigurableMetadata 7: org.springframework.roo.addon.javabean.JavaBeanMetadata 9: org.springframework.roo.addon.tostring.ToStringMetadata 11: org.springframework.roo.addon.dod.DataOnDemandMetadata 25: org.springframework.roo.addon.test.IntegrationTestMetadata 26: org.springframework.roo.addon.entity.EntityMetadata 37: org.springframework.roo.addon.finder.FinderMetadata 66: org.springframework.roo.addon.beaninfo.BeanInfoMetadata 147: org.springframework.roo.addon.plural.PluralMetadata 239: org.springframework.roo.process.manager.internal.DefaultFileManager 367: org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadata 3063: org.springframework.roo.addon.web.mvc.jsp.JspMetadata Startup exec 6631 ms As such the net result is: Without controllers: 4632 vs 3112 (1.5 times faster) With controllers: 19694 vs 6631 (2.9 times faster) Stefan is going to have a look in the JspMetadata to see what we can do to speed it up as well.
        Hide
        Marc Pancheri added a comment -

        Thanks Ben for the changes, it should be really better. It seems that the more controllers and views you have, the more the performance problem is taking time to ROO. With only 5 entities it takes 20 seconds, with 100, it takes 20 minutes and if you have relations between your entities, it looks to be even longer.

        I did a try with ROO 1.1.0M1 removing all controllers and views on my 100 entities and it takes about 20 seconds to validate it all. The problem really seems to be in the webapp part.

        I'll try your M2 version to see if the problem is solved on my full model.

        Show
        Marc Pancheri added a comment - Thanks Ben for the changes, it should be really better. It seems that the more controllers and views you have, the more the performance problem is taking time to ROO. With only 5 entities it takes 20 seconds, with 100, it takes 20 minutes and if you have relations between your entities, it looks to be even longer. I did a try with ROO 1.1.0M1 removing all controllers and views on my 100 entities and it takes about 20 seconds to validate it all. The problem really seems to be in the webapp part. I'll try your M2 version to see if the problem is solved on my full model.

          People

          • Assignee:
            Ben Alex
            Reporter:
            Marc Pancheri
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: