[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Implemented fast string append and a new call a = string.append(a, b)
- From: "James Dennett" <james.dennett@...>
- Date: Sat, 29 Nov 2008 17:04:22 -0800
On Sat, Nov 29, 2008 at 4:28 PM, Paul Sheer <paulsheer@gmail.com> wrote:
>
> Thanks for the info.
>
> Performance is one thing.
>
> But all high-level languages *should* have proper dynamic strings.
For some definition of "proper dynamic strings".
> If this were not true, than PIL would not need to mention the warning
> in section 11.6.
>
> Basically, all programmers expect that a = a .. b should be efficient.
I doubt that. The equlvalent in C++ (a = a + b) is rather
inefficient, but C++ does have a more efficient mutating operator
(a+=b). Java programmers will also expect a=a+b to be inefficient,
and will use a StringBuilder in general. In general, a = a + b is
inefficient as it creates too many objects.
-- James