velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph.R...@dlr.de
Subject Re: that statement takes 20s !!!!
Date Wed, 11 Dec 2002 14:51:56 GMT
Hi,

since velocity has performed *very* fast for so many users that
have stated this to the list, I suspect that the CPU time is swalloed
somewhere else. Please check and try the following:
* Procoess memory consumption - if the Java VM gets to the
   permitted heap space (-mX command line argument) it will
   start the GC and slow down.
* Add a tool to the context and test the $mainContainer calls,
   I suspect that somewhere in your code it may chew up the time:
     <!-- start $timetool.init() -->## set the timer to current time
     ...
     <!-- Time at step0=$timetool.test() -->
       $mainContainer
     <!-- Time at step1=$timetool.test() -->
     ...

Cocosila wrote:
> Hello, 
> 
> 
>  Sorry for the delay. Here are the information about the case:
>  
>   * the template is in the attachment
>   
>   * about the objects, there are 20 simple data containers in $list.
>   Each of these containers have references to other containers like 
>   objects (Characteristics, Classification).
>   
>   * and YES only that evaluate takes 20s !! I calculate like this:
>   
>   start = System.currentTimeMillis();
>   Velocity.evaluate(context, outWriter,
>       page + "-DB VM-", vtlCode);
>   stop = System.currentTimeMillis();
>   logger.debug("Time for evaluating the " + page + " VTL code: "
>          + (stop - start));
>          
>   All suggestions are welcome !
>   
> Best regards,
>  Dan
> 
> 
> ------------------------------------------------------------------------
> 
> #macro( nextColor $classe )
> 	#if( $classe == "fond" )
> 		#set( $classe = "fond3" )
> 	#else
> 		#set( $classe = "fond" )
> 	#end
> #end
> <html>
> 
> <head></head>
> 
> <body>
> 
> 
> 
> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="1">
> 
> 
> #set( $classe = "fond3" )
> 
> #foreach( $mainContainer in $list)
> 	#nextColor($classe)
> 	<tr class="$classe">
> 		<td width="80" align="center" valign="middle">
> 			#set( $nbStars = [$mainContainer.getCharacteristics().getClassification().getValue()..1]
)
> 			#foreach( $star in $nbStars )
> 				<img src="/look/$partner/images/star.gif">
> 			#end
> 		</td>
> 		<td>
> 			<b>
> 				<a class="lien"
> 				   href="/servlets/contexthandling?pg=2&house=$mainContainer.getCharacteristics().getId()&postfix=Ehr">
> 					$mainContainer.getReception()
> 				</a>
> 			</b>
> 			</br>
> 			<b class="texteP">$mainContainer.getCity()</b>
> 		</td>
> 		<td width="70" align="center" nowrap>
> 			<span class="colorP">
> 				$mainContainer.getCharacteristics().getLowPrice()
> 				&nbsp;$mainContainer.getCurrencyCode()
> 			</span>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td colspan="3" class="fond">
> 			<IMG src="/look/$partner/images/pxtransparent.gif" width="1" height="1">
> 		</td>
> 	</tr>
> #end
> 
> </table>
> 
> 
> 
> </body>
> </html
> 
>>
>>------------------------------------------------------------------------
>>
>>--
>>To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>

-- 
:) Christoph Reck


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message