On Tue, 29 Jan 2002, Christopher K. St. John wrote:

> Anton Tagunov wrote:
> >
> > out.write("<html>");
> > generally results in the string being sent right to the user via
> > the underlying socket implementation without any memory allocation.
> >
>
>  Premature optimization is the root of all evil :-)
>
>  Most servlet containers buffer by default, see the apidocs
> for javax.servlet.Response, specifically setBufferSize(). So
> the String will not generally be sent directly to the
> underlying socket implementation.
>
>  In any case, if you're concerned with performance, you want
> to avoid calls write() (the Java IO code is notoriously slow),
> and the best way to do that is with big buffers.
>
>  Making the code awkward in order to save a few bytes of
> memory is something that you should only do if you're
> really desperate.

Besides, doesn't using a string literal like "<html>" actually create
an object in Java?  (Meaning that it does use some memory.)

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to