Re: Can a FastWriter ever be recycled in the current model?
Alex Twisleton-Wykeham-Fiennes <[email protected]> Thu, 16 Mar 2006 16:24:56 +0000
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
On Thu 16 March 2006 16:18, Keats Kirsch wrote:
> Alex Twisleton-Wykeham-Fiennes wrote:
> >... obvious to remove is
> >the ByteBufferOutputStream.reset() which currently is implemented as:-
> >
> > /**
> > * Clear the contents of the byte buffer. Also shrinks the byte buffer
> > * to the size specified during construction of this
> > ByteBufferOutputStream */
> > public void reset ()
> > {
> > _pos = 0;
> > _buf = new byte[_initialSize];
> > }
> >
> >This is currently (in my testbed) only ever getting invoked during:-
> >
> > ByteBufferOutputStream.reset()
>
> [I assume this is a typo and it doesn't actually call itself. ]
sorry, I was just copying from the call tree on OptimizeIt - the FastWriter
flush() method invokes reset() on the ByteBufferOutputStream which does not
call reset() on itself again...
> > FastWriter.flush()
>
> I agree that this shouldn't re-allocate.
>
> > FastWriter.close()
>
> No sense allocating on a close.
>
> > WMTemplate.evaluateAsBytes()
>
> I'm not quite sure why this would reset anything. It seems like you
> should explicitly flush or close after evaluating if you want to.
I think that there used to be a pool of FastWriters so it was tidying up the
contents before returning it to the pool. This is no longer there (as
pointed out by Eric) so the code is no longer required.
A
> Keats
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live
> webcast and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Webmacro-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/webmacro-user
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642