You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Marta Gascó Julio <mg...@care-t.com> on 2007/11/29 18:16:05 UTC

Doubt about Velocity and performance when using Unicode Encoding

Hello Velocity users, 

I would like to expose my doubt to you, looking forward for some help from you. 

I'm using Velocity as a Template engine in my project and I was happy with its performace until I decided use Arabian words in my templates. I changed the Encondig to Unicode to make it possible, but since that moment, the time needed to Velocity making the "merge" has increased really much. 

I changed my line: lNVTemplate.Merge(lNVContext, lStringWriter);

For: Velocity.MergeTemplate(lNVTemplate.Name, System.Text.Encoding.Unicode.EncodingName, lNVContext, lStringWriter); 

Am I doing any badly? Or is it defect of Velocity? Has any of you experienced something like that? Is there any other possibility of merging templates with Arabian symbols? 

Thanks in advance for your help.

Marta.

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


Re: Doubt about Velocity and performance when using Unicode Encoding

Posted by jian chen <ch...@gmail.com>.
Hi, Marta,

I don't see a problem either. I used Velocity engine to load Chinese
characters in UTF-8 format and don't see any problem with that.

Jian
www.jiansnet.com
Quality Search with Affordable Price

On Nov 29, 2007 11:01 AM, Will Glass-Husain <wg...@gmail.com> wrote:

> Hi Marta,
>
> Typically, performance problems are caused by the cache not being turned
> on.  Did you enable the cache for your resource loader?
>
> I haven't seen a problem due to encoding. Would surprise me if the unicode
> was the issue.  Maybe there's a difference between the template.merge and
> the Velocity.merge calls?
>
> For true scientific comparison, can you run your benchmarks with the new
> method call (Velocity.merge) but with the standard encoding?  (Whatever
> you
> used originally with getTemplate).
>
> WILL
>
>
> On Nov 29, 2007 9:16 AM, Marta Gascó Julio <mg...@care-t.com> wrote:
>
> > Hello Velocity users,
> >
> > I would like to expose my doubt to you, looking forward for some help
> from
> > you.
> >
> > I'm using Velocity as a Template engine in my project and I was happy
> with
> > its performace until I decided use Arabian words in my templates. I
> changed
> > the Encondig to Unicode to make it possible, but since that moment, the
> time
> > needed to Velocity making the "merge" has increased really much.
> >
> > I changed my line: lNVTemplate.Merge(lNVContext, lStringWriter);
> >
> > For: Velocity.MergeTemplate(lNVTemplate.Name,
> > System.Text.Encoding.Unicode.EncodingName, lNVContext, lStringWriter);
> >
> > Am I doing any badly? Or is it defect of Velocity? Has any of you
> > experienced something like that? Is there any other possibility of
> merging
> > templates with Arabian symbols?
> >
> > Thanks in advance for your help.
> >
> > Marta.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
>

Re: Doubt about Velocity and performance when using Unicode Encoding

Posted by Will Glass-Husain <wg...@gmail.com>.
Hi Marta,

Typically, performance problems are caused by the cache not being turned
on.  Did you enable the cache for your resource loader?

I haven't seen a problem due to encoding. Would surprise me if the unicode
was the issue.  Maybe there's a difference between the template.merge and
the Velocity.merge calls?

For true scientific comparison, can you run your benchmarks with the new
method call (Velocity.merge) but with the standard encoding?  (Whatever you
used originally with getTemplate).

WILL


On Nov 29, 2007 9:16 AM, Marta Gascó Julio <mg...@care-t.com> wrote:

> Hello Velocity users,
>
> I would like to expose my doubt to you, looking forward for some help from
> you.
>
> I'm using Velocity as a Template engine in my project and I was happy with
> its performace until I decided use Arabian words in my templates. I changed
> the Encondig to Unicode to make it possible, but since that moment, the time
> needed to Velocity making the "merge" has increased really much.
>
> I changed my line: lNVTemplate.Merge(lNVContext, lStringWriter);
>
> For: Velocity.MergeTemplate(lNVTemplate.Name,
> System.Text.Encoding.Unicode.EncodingName, lNVContext, lStringWriter);
>
> Am I doing any badly? Or is it defect of Velocity? Has any of you
> experienced something like that? Is there any other possibility of merging
> templates with Arabian symbols?
>
> Thanks in advance for your help.
>
> Marta.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com