cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject Re: XSP confusion
Date Fri, 26 May 2000 00:42:21 GMT
Stefano Mazzocchi wrote:
> Question:
> 
> is there a performance difference between
> 
>   this.characters("ciao".getChars());
> 
> and
> 
>   Chars ciao = {'c','i','a','o'};
>   ...
>   this.characters(ciao);
> 
> (modulo java syntax errors, consider it pseudocode)
> 
> I think so since the "ciao" string is translated into unicode and then
> converted using the current local at runtime....
> 
> Ricardo, since we declare the encoding on the XSP, shouldn't we
> _preconvert_ all those strings into char arrays to avoid this at
> runtime? I'm sure it could speed up simple println XSP pages by very
> much.

I'll add this to code-generation document preprocessing. Yes, sir!

Generated code can be even space-optimized: If a given string happens to
be  a substring of another string, the latter can be "reused" by passing
characters() the appropriate offset and length. This is probaly what
SAX designers intended in the first place when they defined this
otherwise
"weird" method...

Mime
View raw message