Re: PATCH: Speed up direct string concatenation by 20+%!
- From: Robin Becker <robin@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Sep 2006 08:04:25 +0000
Larry Hastings wrote:
______
THE PATCH.........
The core concept: adding two strings together no longer returns a pure
"string" object. Instead, it returns a "string concatenation" object
which holds references to the two strings but does not actually
concatenate
them... yet. The strings are concatenated only when someone requests
the
string's value, at which point it allocates all the space it needs and
renders the concatenated string all at once.
More to the point, if you add multiple strings together (a + b + c),
it *doesn't* compute the intermediate strings (a + b).
Upsides to this approach:
wouldn't this approach apply to other additions eg list+list seq+seq etc etc.
I suppose the utility of such an approach depends on the frequency with which multiple strings/lists/sequences etc are added together in real code.
--
Robin Becker
.
- Follow-Ups:
- Re: PATCH: Speed up direct string concatenation by 20+%!
- From: cfbolz
- Re: PATCH: Speed up direct string concatenation by 20+%!
- From: Carl Friedrich Bolz
- Re: PATCH: Speed up direct string concatenation by 20+%!
- From: Carl Friedrich Bolz
- Re: PATCH: Speed up direct string concatenation by 20+%!
- From: Carl Friedrich Bolz
- Re: PATCH: Speed up direct string concatenation by 20+%!
- References:
- PATCH: Speed up direct string concatenation by 20+%!
- From: Larry Hastings
- PATCH: Speed up direct string concatenation by 20+%!
- Prev by Date: Re: vector and particle effects
- Next by Date: Re: How to find number of characters in a unicode string?
- Previous by thread: Re: PATCH: Speed up direct string concatenation by 20+%!
- Next by thread: Re: PATCH: Speed up direct string concatenation by 20+%!
- Index(es):
Relevant Pages
|