You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by shunhao chen <nu...@yahoo.com.cn> on 2010/06/20 18:24:57 UTC

How to speed up tomcat 5.5 jsp precompilation?

Hi all,
         I have 2100 jsp files in my system, and I use the following ant script to precompile my jsp files. It takes 10 minutes to complete. 10 minutes is too long for me, because I also need to run class obfuscation, js/css compressor and test case. It’s any tips for me to speed up the precompilation?
==============================================================================
The following is my ant script:
   <target name="common.compilejsp">
      <taskdef classname="org.apache.jasper.JspC" name="jasper2">
         <classpath id="jspc.classpath">
            <pathelement location="${java.home}/../lib/tools.jar" />
            <fileset dir="${tomcat.home}/bin">
               <include name="*.jar" />
            </fileset>
            <fileset dir="${tomcat.home}/server/lib">
               <include name="*.jar" />
            </fileset>
            <fileset dir="${tomcat.home}/common/lib">
               <include name="*.jar" />
            </fileset>
         </classpath>
      </taskdef>
 
      <delete failonerror="false" dir="${build.dir}/jspsrc"/>
      <mkdir dir="${build.dir}/jspsrc"/>
      <echo>${jsp.srcdir}</echo>
      <jasper2 validateXml="false" uriroot="${jsp.srcdir}"
         webXmlFragment="${basedir}/generated_web.xml"
         outputDir="${build.dir}/jspsrc" >
      </jasper2>        
     
      <javac destdir="${jsp.compilation.destdir}" optimize="off"
         debug="off" failonerror="${failonerror.during.compilation}" srcdir="${build.dir}/jspsrc"
         encoding="UTF-8" fork="true" memoryMaximumSize="1280M">
         <classpath>
            <pathelement location="${8th.classes.dir}" />
            <fileset dir="${8th.lib.dir}">
               <include name="*.jar" />
            </fileset>
            <pathelement location="${tomcat.home}/common/classes" />
            <fileset dir="${tomcat.home}/common/lib">
               <include name="*.jar" />
            </fileset>
            <pathelement location="${tomcat.home}/shared/classes" />
            <fileset dir="${tomcat.home}/shared/lib">
               <include name="*.jar" />
            </fileset>
            <fileset dir="${tomcat.home}/bin">
               <include name="*.jar" />
            </fileset>
         </classpath>
         <include name="**/*.java" />
      </javac>
   </target>
 
Regards,
Eric chen


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to speed up tomcat 5.5 jsp precompilation?

Posted by David kerber <dc...@verizon.net>.
On 6/21/2010 7:48 AM, Pid wrote:
> On 20/06/2010 17:24, shunhao chen wrote:
>> Hi all,
>>           I have 2100 jsp files in my system, and I use the following ant script to precompile my jsp files. It takes 10 minutes to complete. 10 minutes is too long for me, because I also need to run class obfuscation, js/css compressor and test case. It’s any tips for me to speed up the precompilation?

Do they all change every time you need to compile?  Could you tweak your 
script so that only the changed ones are compiled?  I know nothing about 
Ant, so don't know if that's possible or not.

D

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to speed up tomcat 5.5 jsp precompilation?

Posted by Pid <pi...@pidster.com>.
On 20/06/2010 17:24, shunhao chen wrote:
> Hi all,
>          I have 2100 jsp files in my system, and I use the following ant script to precompile my jsp files. It takes 10 minutes to complete. 10 minutes is too long for me, because I also need to run class obfuscation, js/css compressor and test case. It’s any tips for me to speed up the precompilation?

Your options include getting a faster computer.

The design of your JSPs could influence the amount of time it takes to
do the compilation.  If you're using lots of different taglibs for example.

AFAIK there's no settings you can tweak to make compilation go faster.


p


> ==============================================================================
> The following is my ant script:
>    <target name="common.compilejsp">
>       <taskdef classname="org.apache.jasper.JspC" name="jasper2">
>          <classpath id="jspc.classpath">
>             <pathelement location="${java.home}/../lib/tools.jar" />
>             <fileset dir="${tomcat.home}/bin">
>                <include name="*.jar" />
>             </fileset>
>             <fileset dir="${tomcat.home}/server/lib">
>                <include name="*.jar" />
>             </fileset>
>             <fileset dir="${tomcat.home}/common/lib">
>                <include name="*.jar" />
>             </fileset>
>          </classpath>
>       </taskdef>
>  
>       <delete failonerror="false" dir="${build.dir}/jspsrc"/>
>       <mkdir dir="${build.dir}/jspsrc"/>
>       <echo>${jsp.srcdir}</echo>
>       <jasper2 validateXml="false" uriroot="${jsp.srcdir}"
>          webXmlFragment="${basedir}/generated_web.xml"
>          outputDir="${build.dir}/jspsrc" >
>       </jasper2>        
>      
>       <javac destdir="${jsp.compilation.destdir}" optimize="off"
>          debug="off" failonerror="${failonerror.during.compilation}" srcdir="${build.dir}/jspsrc"
>          encoding="UTF-8" fork="true" memoryMaximumSize="1280M">
>          <classpath>
>             <pathelement location="${8th.classes.dir}" />
>             <fileset dir="${8th.lib.dir}">
>                <include name="*.jar" />
>             </fileset>
>             <pathelement location="${tomcat.home}/common/classes" />
>             <fileset dir="${tomcat.home}/common/lib">
>                <include name="*.jar" />
>             </fileset>
>             <pathelement location="${tomcat.home}/shared/classes" />
>             <fileset dir="${tomcat.home}/shared/lib">
>                <include name="*.jar" />
>             </fileset>
>             <fileset dir="${tomcat.home}/bin">
>                <include name="*.jar" />
>             </fileset>
>          </classpath>
>          <include name="**/*.java" />
>       </javac>
>    </target>
>  
> Regards,
> Eric chen
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>