[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Plans for version 5.0?
- From: Philippe Lhoste <PhiLho@...>
- Date: Wed, 23 Oct 2002 08:07:24 +0000 (UTC)
On 2002/10/22 18:45:19, Roberto Ierusalimschy <email@example.com>
>> Perhaps Lua 5 might need string buffers (growable buffer of
>> characters), so that string manipulation becomes more efficient. I
>> read somewhere (but forgot the URL) that Lua performs very well (w.r.t
>> other scripting languages) except for string manipulation. But I may
>> be wrong!
> It is quite easy to implement a string buffer in Lua itself; see
Interesting, it seems to be an implementation of the LTN9
But I think Basile meant "efficient string buffers"...
Your implementation is good, of course, but still seems (if I understood
the algorithm) to suffer (to a lesser extent) of some of the old problems:
it is quite memory intensive as it uses a table to store parts of the
buffer, and when closing it, we still have to concatenate the parts,
generating garbage to collect.
Now, a string buffer library can be written quite easily and efficiently.
The hard part may be to allow smooth integration with native strings. Or
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist