+1 to do it now. if this does affect 1.2 only interfaces a lot then we should do this before we actually release those interfaces into the wild.

-Igor


On 4/1/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
Currently almost all our interfaces that makes the output or Response writing code are using Strings
as parameters or return types

I would like to change all those methods to use Charsequence because this would mean that
we don't have to do toString() every where and just passing directly the buffer that was made
This will greatly reduce String char array copies.

This does mean that for example:

Response.write(String) -> Response.write(CharSequence)

and

protected final void replaceComponentTagBody(final MarkupStream markupStream,
            final ComponentTag tag, final String body)

protected final void replaceComponentTagBody(final MarkupStream markupStream,
            final ComponentTag tag, final CharSequence body)

for calling methods nothing will really change because the String maps on its interface.

Only when users have implemented such a method they should also convert
so for the above replaceComponentTagBody this is not a problem because it is final anyway

But for Response.write() subclasses should also be refactored.


Don't know currently yet how many overridable methods really would be affected.
But it could enhance performance quite a bit.

Many of the interfaces that would affected are 1.2 only interfaces so if we change them now
those interfaces never made it to a final version.

So what should we do:

[ ] do it in 1.2
[ ] do it in 2.0/1.3 with another big refactor? (then interfaces introduced in 1.2 will change again)
[ ] never do it.

johan


Reply via email to