Re: StringBuffer/StringBuilder efficiency
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Sep 2009 17:12:40 -0700
On Sun, 27 Sep 2009 17:54:04 +0100, Tom Anderson
<twic@xxxxxxxxxxxxxxx> wrote, quoted or indirectly quoted someone who
said :
Almost always, i suspect. Certainly a common case that looks worth
optimising for.
In the ordinary case, the only methods of StringBuilder you use are
append and toString. Consider that server side code is mostly just
appending strings to put together the response. I think you might hit
20% improvement over what is typically done now with something that
avoids allocating RAM needlessly and copying needlessly. Multiply
that savings by all the Java servers out in the world, and you have
something worth doing.
Reducing CPU cycles has an additional payoff since these servers
typically use less AC power when not doing useful work. The cost of
power is becoming increasingly important in the overall economics of
servers.
--
Roedy Green Canadian Mind Products
http://mindprod.com
On two occasions I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
~ Charles Babbage (born: 1791-12-26 died: 1871-10-18 at age: 79)
.
- References:
- StringBuffer/StringBuilder efficiency
- From: Wojtek
- Re: StringBuffer/StringBuilder efficiency
- From: Roedy Green
- Re: StringBuffer/StringBuilder efficiency
- From: Lew
- Re: StringBuffer/StringBuilder efficiency
- From: Roedy Green
- Re: StringBuffer/StringBuilder efficiency
- From: Peter Duniho
- Re: StringBuffer/StringBuilder efficiency
- From: Roedy Green
- Re: StringBuffer/StringBuilder efficiency
- From: Tom Anderson
- Re: StringBuffer/StringBuilder efficiency
- From: Roedy Green
- Re: StringBuffer/StringBuilder efficiency
- From: Patricia Shanahan
- Re: StringBuffer/StringBuilder efficiency
- From: Tom Anderson
- StringBuffer/StringBuilder efficiency
- Prev by Date: Re: JSP Methods
- Next by Date: Re: StringBuffer/StringBuilder efficiency
- Previous by thread: Re: StringBuffer/StringBuilder efficiency
- Next by thread: Re: StringBuffer/StringBuilder efficiency
- Index(es):
Relevant Pages
|