commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Duprat" <christopher.dup...@wanadoo.fr>
Subject Re: StringBuffer pools and why not to use them
Date Tue, 18 Feb 2003 17:54:25 GMT
Well said,

First allocation : 500 is too big
Second Concatenation : it take more time to concatenate string than append
them!

StringBuffer buf = new StringBuffer(124);
buf.append("This is a test under ");
buf.append(System.getProperty("os.arch") );
buf.append(" operating system, version ");
buf.append(System.getProperty("os.version"));


----- Original Message -----
From: "Robert Simmons" <derisor@arcor.de>
To: <commons-user@jakarta.apache.org>
Sent: Tuesday, February 18, 2003 6:13 PM
Subject: Re: StringBuffer pools and why not to use them


> Well now ... I think this post goes a bit far. At least he tried the task
before
> advocating it. The fact is that a large number of people poorly use
StringBuffer
> anyway. This could account for performance hits. The simple line of code
that
> you see all the time like:
>
> StringBuffer buf = new StringBuffer(500);
> buf.append("This is a test under " + System.getProperty("os.arch") +
>                   " operating system, version " +
> System.getProperty("os.version"));
>
> This code has a serious problem. Since you are so busy calling others
idiots,
> can you tell us all why ?
>
> -- Robert
>
> "Chris Duprat" <christopher.duprat@wanadoo.fr> wrote in message
> news:005001c2d76c$a542bf50$8dfb0d50@zzz...
> > Wasting of time. You shouldn't have the idea of implementing a pool for
such
> > objects because of their high availability. By adding another level you
just
> > reach the performance issue which is critical for that kind of objects.
> >
> > You're an Idiot ;-)
> > http://www.pagetutor.com/idiot/idiot.html
> >
> > Cheers,
> > Chris
> >
> > ----- Original Message -----
> > From: "Lester Ward" <lward@tagaudit.com>
> > To: <commons-user@jakarta.apache.org>
> > Sent: Tuesday, February 18, 2003 4:19 PM
> > Subject: StringBuffer pools and why not to use them
> >
> >
> > > I was doing some performance tuning recently and thought to try
pooling
> > > StringBuffers. I built a pool for them based on StackKeydObjectPool.
Bad
> > > idea. Here is why:
> > >
> > > http://www.divnull.com/lward/personal/writing/stringpool.html
> > >
> > > Comments welcome.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


Mime
View raw message