velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@adeptra.com>
Subject Re: #parse performance question
Date Sat, 10 Aug 2002 16:27:54 GMT
On 8/9/02 5:55 PM, "plynchnlm@netscape.net" <plynchnlm@netscape.net> wrote:

> Should one avoid calling #parse inside foreach loops?  Or does the
> file that is parsed get cached somehow?  I am wondering which
> of the following would be better:
> 
> #foreach ($a in $list)
> #parse('fileThatUsesA')
> #end

As long as you have caching turned on, the resource 'fileThatUsesA' will be
parsed only once and then cached.

A good alternative is to use a VelociMacro so you can pass the arg directly,
rather than hoping for a match between the reference used in the foreach()
and the ref used in the parsed file.


> 
> or
> 
> #parse('fileThatContainsForeachOnList')
> 
> Thanks,
>  --Paul
> 
> 
> __________________________________________________________________
> Pre-order the NEW Netscape 7.0 browser. Reserve your FREE CD and pay only
> $2.99 shipping and handling. http://cd.netscape.com/promo_one/
> 
> Get your own FREE, personal Netscape Mail account today at
> http://webmail.netscape.com/
> 
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
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