You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alexander Varakin <av...@gmail.com> on 2006/01/14 05:00:12 UTC

First page display slowdown in v 4.0

Hi,

I noticed that in v4.0 first page display takes much longer than in v 3.0.3:  
15 sec vs 7 sec.
I used the helloworld application for testing.
My environment is:  
   JBoss 4.0.2 (also tried Jetty and Tomcat, same result) 
   Sun JDK 1.5.06
   Intel Celeron 1.7GHz Laptop 
   512 MB RAM
   Debian Linux Unstable (also tried in Windows, same result)

Is there any way to improve this time?

Thanks,
Alex

 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Bryan Lewis <br...@maine.rr.com>.
I hear what you're saying!  I prefer the good old
compiled-strong-type-checking Java approach... not a fan of perl,
haven't tried ruby.  I don't even like annotations yet. :-)  But I saw
some comments on the web that appeared to be  promising instant
turn-around for simple edits and I wanted it if I could get it.  Up till
now I've been happy with instant turn-around for html/page edits.  I can
live with an auto-reload after a code change, now that I know that's
what people are talking about.

Thanks for the clarification.


Patrick Casey wrote:

>	That's the expected behavior. When you change a java file, your IDE
>recompiles the .class file. That, in turn, causes Tomcat (if reloadable is
>true) to throw away the current set of classes in memory and do a reload.
>For a simple project, this doesn't take long at all, but when you have large
>frameworks getting reloaded, be it Hibernate or Hivemind, you're going to
>take a performance hit.
>
>	A good rule of thumb is that if you're trying to hot-patch live code
>on a regular basis, take a step back and work a bit on your coding
>practices. Especially if you come from a dynamic language background like
>perl or ruby it's tempting to just start hacking the code of a running
>program. That's not usually the best approach with java though, despite the
>fact that with a modern IDE and debugger you can work this way.
>
>	Generally speaking you're better off making a bunch of changes at
>once, doing a recompile, and testing, rather than trying to hot fix them one
>at a time.
>
>	--- Pat
>
>  
>
>>-----Original Message-----
>>From: Bryan Lewis [mailto:bryan@maine.rr.com]
>>Sent: Monday, January 16, 2006 8:18 PM
>>To: Tapestry users
>>Subject: Re: First page display slowdown in v 4.0
>>
>>Yes, I tried that.  Whenever I changed a java file, the app context got
>>restarted which was rather slow.  Took 10 seconds for the app to be
>>ready to use again.  Is that what's supposed to happen?  I was hoping
>>for something like a one-second reload of just the one file that changed.
>>
>>
>>Patrick Casey wrote:
>>
>>    
>>
>>>	Did you set reloadable="true" in your web.xml?
>>>
>>>	--- Pat
>>>
>>>
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Bryan Lewis [mailto:bryan@maine.rr.com]
>>>>Sent: Monday, January 16, 2006 5:29 PM
>>>>To: Tapestry users
>>>>Subject: Re: First page display slowdown in v 4.0
>>>>
>>>>I must be doing something wrong then.  I've tried three app servers,
>>>>currently trying JBoss/Tomcat.  Running inside Eclipse, starting in
>>>>debug mode.  I have Tapestry's caching disabled in the startup
>>>>properties, and changes to the html or page files do take effect
>>>>immediately.  But when I make a small change inside a Java method... it
>>>>does get built  automatically, and the class file does get updated in
>>>>the webapp tree.  But the change doesn't show up in the browser until I
>>>>restart the server or reload the app.
>>>>
>>>>
>>>>Alexander Varakin wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>Hot-code-replace feature is available in Eclipse if you run web
>>>>>          
>>>>>
>>container
>>    
>>
>>>>>          
>>>>>
>>>>in
>>>>
>>>>
>>>>        
>>>>
>>>>>debug mode. The problem is that it takes twice longer to display first
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>page
>>>>
>>>>
>>>>        
>>>>
>>>>>in debug mode. Also Hot-code-replace works only if you don't touch
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>function
>>>>
>>>>
>>>>        
>>>>
>>>>>declarations.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>        
>>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


RE: First page display slowdown in v 4.0

Posted by Patrick Casey <pa...@adelphia.net>.
	That's the expected behavior. When you change a java file, your IDE
recompiles the .class file. That, in turn, causes Tomcat (if reloadable is
true) to throw away the current set of classes in memory and do a reload.
For a simple project, this doesn't take long at all, but when you have large
frameworks getting reloaded, be it Hibernate or Hivemind, you're going to
take a performance hit.

	A good rule of thumb is that if you're trying to hot-patch live code
on a regular basis, take a step back and work a bit on your coding
practices. Especially if you come from a dynamic language background like
perl or ruby it's tempting to just start hacking the code of a running
program. That's not usually the best approach with java though, despite the
fact that with a modern IDE and debugger you can work this way.

	Generally speaking you're better off making a bunch of changes at
once, doing a recompile, and testing, rather than trying to hot fix them one
at a time.

	--- Pat

> -----Original Message-----
> From: Bryan Lewis [mailto:bryan@maine.rr.com]
> Sent: Monday, January 16, 2006 8:18 PM
> To: Tapestry users
> Subject: Re: First page display slowdown in v 4.0
> 
> Yes, I tried that.  Whenever I changed a java file, the app context got
> restarted which was rather slow.  Took 10 seconds for the app to be
> ready to use again.  Is that what's supposed to happen?  I was hoping
> for something like a one-second reload of just the one file that changed.
> 
> 
> Patrick Casey wrote:
> 
> >	Did you set reloadable="true" in your web.xml?
> >
> >	--- Pat
> >
> >
> >
> >>-----Original Message-----
> >>From: Bryan Lewis [mailto:bryan@maine.rr.com]
> >>Sent: Monday, January 16, 2006 5:29 PM
> >>To: Tapestry users
> >>Subject: Re: First page display slowdown in v 4.0
> >>
> >>I must be doing something wrong then.  I've tried three app servers,
> >>currently trying JBoss/Tomcat.  Running inside Eclipse, starting in
> >>debug mode.  I have Tapestry's caching disabled in the startup
> >>properties, and changes to the html or page files do take effect
> >>immediately.  But when I make a small change inside a Java method... it
> >>does get built  automatically, and the class file does get updated in
> >>the webapp tree.  But the change doesn't show up in the browser until I
> >>restart the server or reload the app.
> >>
> >>
> >>Alexander Varakin wrote:
> >>
> >>
> >>
> >>>Hot-code-replace feature is available in Eclipse if you run web
> container
> >>>
> >>>
> >>in
> >>
> >>
> >>>debug mode. The problem is that it takes twice longer to display first
> >>>
> >>>
> >>page
> >>
> >>
> >>>in debug mode. Also Hot-code-replace works only if you don't touch
> >>>
> >>>
> >>function
> >>
> >>
> >>>declarations.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Bryan Lewis <br...@maine.rr.com>.
Yes, I tried that.  Whenever I changed a java file, the app context got
restarted which was rather slow.  Took 10 seconds for the app to be
ready to use again.  Is that what's supposed to happen?  I was hoping
for something like a one-second reload of just the one file that changed.


Patrick Casey wrote:

>	Did you set reloadable="true" in your web.xml?
>
>	--- Pat
>
>  
>
>>-----Original Message-----
>>From: Bryan Lewis [mailto:bryan@maine.rr.com]
>>Sent: Monday, January 16, 2006 5:29 PM
>>To: Tapestry users
>>Subject: Re: First page display slowdown in v 4.0
>>
>>I must be doing something wrong then.  I've tried three app servers,
>>currently trying JBoss/Tomcat.  Running inside Eclipse, starting in
>>debug mode.  I have Tapestry's caching disabled in the startup
>>properties, and changes to the html or page files do take effect
>>immediately.  But when I make a small change inside a Java method... it
>>does get built  automatically, and the class file does get updated in
>>the webapp tree.  But the change doesn't show up in the browser until I
>>restart the server or reload the app.
>>
>>
>>Alexander Varakin wrote:
>>
>>    
>>
>>>Hot-code-replace feature is available in Eclipse if you run web container
>>>      
>>>
>>in
>>    
>>
>>>debug mode. The problem is that it takes twice longer to display first
>>>      
>>>
>>page
>>    
>>
>>>in debug mode. Also Hot-code-replace works only if you don't touch
>>>      
>>>
>>function
>>    
>>
>>>declarations.
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


RE: First page display slowdown in v 4.0

Posted by Patrick Casey <pa...@adelphia.net>.
	Did you set reloadable="true" in your web.xml?

	--- Pat

> -----Original Message-----
> From: Bryan Lewis [mailto:bryan@maine.rr.com]
> Sent: Monday, January 16, 2006 5:29 PM
> To: Tapestry users
> Subject: Re: First page display slowdown in v 4.0
> 
> I must be doing something wrong then.  I've tried three app servers,
> currently trying JBoss/Tomcat.  Running inside Eclipse, starting in
> debug mode.  I have Tapestry's caching disabled in the startup
> properties, and changes to the html or page files do take effect
> immediately.  But when I make a small change inside a Java method... it
> does get built  automatically, and the class file does get updated in
> the webapp tree.  But the change doesn't show up in the browser until I
> restart the server or reload the app.
> 
> 
> Alexander Varakin wrote:
> 
> >Hot-code-replace feature is available in Eclipse if you run web container
> in
> >debug mode. The problem is that it takes twice longer to display first
> page
> >in debug mode. Also Hot-code-replace works only if you don't touch
> function
> >declarations.
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Bryan Lewis <br...@maine.rr.com>.
I must be doing something wrong then.  I've tried three app servers,
currently trying JBoss/Tomcat.  Running inside Eclipse, starting in
debug mode.  I have Tapestry's caching disabled in the startup
properties, and changes to the html or page files do take effect
immediately.  But when I make a small change inside a Java method... it
does get built  automatically, and the class file does get updated in
the webapp tree.  But the change doesn't show up in the browser until I
restart the server or reload the app.


Alexander Varakin wrote:

>Hot-code-replace feature is available in Eclipse if you run web container in 
>debug mode. The problem is that it takes twice longer to display first page 
>in debug mode. Also Hot-code-replace works only if you don't touch function 
>declarations.
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Alexander Varakin <av...@optonline.net>.
Hot-code-replace feature is available in Eclipse if you run web container in 
debug mode. The problem is that it takes twice longer to display first page 
in debug mode. Also Hot-code-replace works only if you don't touch function 
declarations.


> I agree that it's somewhat frustrating.  After upgrading to Tap4, I've
> spent some time looking for the best development environment (trying
> things like JettyLauncher and JBossIDE) that would let me avoid
> restarting the server and Tapestry whenever possible. I haven't been a
> Spindle user before now, but I'm hoping the future Spindle4 will allow
> something like a hot-code-replace feature.
>
> Alexander Varakin wrote:
> >Hi,
> >
> >I noticed that in v4.0 first page display takes much longer than in v
> > 3.0.3: 15 sec vs 7 sec.
> >I used the helloworld application for testing.
> >My environment is:
> >   JBoss 4.0.2 (also tried Jetty and Tomcat, same result)
> >   Sun JDK 1.5.06
> >   Intel Celeron 1.7GHz Laptop
> >   512 MB RAM
> >   Debian Linux Unstable (also tried in Windows, same result)
> >
> >Is there any way to improve this time?
> >
> >Thanks,
> >Alex
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Bryan Lewis <br...@maine.rr.com>.
I believe what you're seeing is just the way it is at this point in
time.  The extra time is used for things like building the Hivemind
registry.  If you turn on debug logging for Tapestry you'll see all the
work that's being done at startup.

In this earlier posting:
http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-user/200509.mbox/%3C001401c5b1cf$4488cd90$800101df@adamgreene%3E

Howard said:

  I'm not thrilled with the slow startup of Tapestry 4, but it's a case
  of "get it right, then get it fast". I'll be looking at ways to speed
  up HiveMind for 1.2, then see if we can make use of that in Tapestry
  4.1. I am pleased that runtime performance is good and, I suspect,
  better than 3.0.

I agree that it's somewhat frustrating.  After upgrading to Tap4, I've
spent some time looking for the best development environment (trying
things like JettyLauncher and JBossIDE) that would let me avoid
restarting the server and Tapestry whenever possible. I haven't been a
Spindle user before now, but I'm hoping the future Spindle4 will allow
something like a hot-code-replace feature.



Alexander Varakin wrote:

>Hi,
>
>I noticed that in v4.0 first page display takes much longer than in v 3.0.3:  
>15 sec vs 7 sec.
>I used the helloworld application for testing.
>My environment is:  
>   JBoss 4.0.2 (also tried Jetty and Tomcat, same result) 
>   Sun JDK 1.5.06
>   Intel Celeron 1.7GHz Laptop 
>   512 MB RAM
>   Debian Linux Unstable (also tried in Windows, same result)
>
>Is there any way to improve this time?
>
>Thanks,
>Alex
>
> 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Alexander Varakin <av...@optonline.net>.
Sorry for double posting:  I sent this message twice: 1st from a wrong e-mail 
account, then I realized that I made a mistake and sent it from a right 
account. Looks like the 1st message  was released today.

BTW, if I run tapestry in Eclipse using Jetty Launcher or Tomcat Launcher in 
debug mode, it takes even longer for 1st page display - about 40 sec.
I profiled the program and it looks like all time is taken in memory 
allocations. 

Alex


On Monday 16 January 2006 02:23 pm, Gregg Bolinger wrote:
> I seem to remember you already asked this question and there were several
> responses.  Did you see them?
>
> Gregg
>
> On 1/13/06, Alexander Varakin <av...@gmail.com> wrote:
> > Hi,
> >
> > I noticed that in v4.0 first page display takes much longer than in v
> > 3.0.3:
> > 15 sec vs 7 sec.
> > I used the helloworld application for testing.
> > My environment is:
> >    JBoss 4.0.2 (also tried Jetty and Tomcat, same result)
> >    Sun JDK 1.5.06
> >    Intel Celeron 1.7GHz Laptop
> >    512 MB RAM
> >    Debian Linux Unstable (also tried in Windows, same result)
> >
> > Is there any way to improve this time?
> >
> > Thanks,
> > Alex
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: First page display slowdown in v 4.0

Posted by Gregg Bolinger <ta...@gmail.com>.
I seem to remember you already asked this question and there were several
responses.  Did you see them?

Gregg

On 1/13/06, Alexander Varakin <av...@gmail.com> wrote:
>
> Hi,
>
> I noticed that in v4.0 first page display takes much longer than in v
> 3.0.3:
> 15 sec vs 7 sec.
> I used the helloworld application for testing.
> My environment is:
>    JBoss 4.0.2 (also tried Jetty and Tomcat, same result)
>    Sun JDK 1.5.06
>    Intel Celeron 1.7GHz Laptop
>    512 MB RAM
>    Debian Linux Unstable (also tried in Windows, same result)
>
> Is there any way to improve this time?
>
> Thanks,
> Alex
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>