- 
        1. Re: SeamTest Performance, is there a way to speed up?gavin.king Feb 14, 2006 12:43 PM (in response to liudan2005)Where is all the time spent at startup? 
- 
        2. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 14, 2006 12:59 PM (in response to liudan2005)Yes, the container startup and initialising the database maping stuffs take a lot of time. Also, If I debug my code, it would be 2-3 times slower. Normally, it takes about 10 - 15 seconds to run my simple test with simple code like em.persist(new MyEntityBean()). If I choose to debug my code, it would take 30 - 40 seconds to run my code. 
 BTW: my database is mysql
- 
        3. Re: SeamTest Performance, is there a way to speed up?gavin.king Feb 14, 2006 1:07 PM (in response to liudan2005)So you mean it is Hibernate startup that is the slowest bit? 
 This is normal.
 There *are* some ways to optimize it, but I'm not sure how easy they are to do in HEM yet.
- 
        4. Re: SeamTest Performance, is there a way to speed up?maxandersen Feb 14, 2006 1:21 PM (in response to liudan2005)first thing you should do is to disable the reflection optimizer: 
 hibernate.cglib.use_reflection_optimizer=false
 that should give much better startup time
- 
        5. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 14, 2006 5:51 PM (in response to liudan2005)I looked the detail of the timer and I can see that Hibernate takes 70% of startup time. My hibernate.cglib.use_reflection_optimizer is set to false by default. Also I've noticed if I reboot my computer and run the test, it would take about 8 seconds. But if I run it again and again, it will be slower and slower. This is really weired, it can't be a momory leak because the jvm is restarted each time I run the test. 
 Also, can someone explain why it's 2 - 3 times slower when debug is turned on?
- 
        6. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 14, 2006 5:53 PM (in response to liudan2005)Also I've noticed it hangs in here for quite a while: 
 WARN 14-02 17:51:40,453 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
- 
        7. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 15, 2006 5:43 AM (in response to liudan2005)I've just noticed it's also very slow in booking example when debug is turned on. Here is the result when I run LoginTest: 
 INFO 15-02 10:31:26,235 (Initialization.java:init:90) -initializing Seam
 ...
 INFO 15-02 10:31:27,735 (Ejb.java:startup:40) -starting the embedded EJB container
 INFO 15-02 10:31:29,564 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
 INFO 15-02 10:31:48,501 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/bookingDatasource'
 ...
 INFO 15-02 10:31:54,157 (Initialization.java:init:95) -done initializing Seam
 As you can see, it takes 28 seconds to initialise Seam. 2 datasources take about 20 seconds to bind. I don't understand why this happens.
 Here is my PC spec:P4 3GHz, 1G RAM, Windows XP. I've tried another computer with AMD 64 and get about same result.
- 
        8. Re: SeamTest Performance, is there a way to speed up?maxandersen Feb 15, 2006 6:46 AM (in response to liudan2005)how many entities do you have ? 
 debug will slow things down, but 2-3 times as slow sounds high...todays jvm's are pretty good at running at close to full speed for debuggin.
- 
        9. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 15, 2006 9:37 AM (in response to liudan2005)As u can see I am now running booking example which takes 28 seconds to initialise when debug is turned on. I don't understand why this happens. 
- 
        10. Re: SeamTest Performance, is there a way to speed up?maxandersen Feb 15, 2006 9:45 AM (in response to liudan2005)(repeat) how many entities do you have ? 
- 
        11. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 15, 2006 11:32 AM (in response to liudan2005)The booking example has got 3 entities: 
 Booking
 Hotel
 User
- 
        12. Re: SeamTest Performance, is there a way to speed up?maxandersen Feb 15, 2006 11:51 AM (in response to liudan2005)hmm so you are saying this is just the plain default setup that takes 28 seconds on your machine ? 
 that sounds pretty weird...last time i ran this it was much faster.
 Can anyone else verify that just starting the booking demo takes that long in their setup ? (and then what that setup is ;)
- 
        13. Re: SeamTest Performance, is there a way to speed up?liudan2005 Feb 15, 2006 12:17 PM (in response to liudan2005)I've rebooted my computer and had nothing running except eclipse. 
 Here is result i've got to run LoginTest:
 run: 6-8 seconds in average
 debug: 28-29 seconds in average
 I am using Seam beta 2.
- 
        14. Re: SeamTest Performance, is there a way to speed up?maxandersen Feb 15, 2006 12:21 PM (in response to liudan2005)and debug is *just* running the jvm in debug mode (not changing the log level's etc.) 
 what jdk/jvm is this ? (i'm a bit surprised ;)
 
     
    