cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: XSP confusion
Date Fri, 26 May 2000 13:28:04 GMT
Ricardo Rocha wrote:
> 
> 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...

Hmmm, interesting.... didn't think of that one... a sort of compilation
compression... very nice indeed.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message