[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: string buffer needs
- From: Paul Smith <paullocal@...>
- Date: Wed, 15 Sep 2004 13:16:20 +0100
void= buffer.append( text_str, ... )
Ability to modify a string 'in place', without creating new entries all
over. This is basically the same as "str ..=" (C-like in-place operator
syntax) would be.
Usage: gathering strings together, big data. Perhaps there's a table
function for this, I'll see.. (yes, 'table.concat' but I still needed to
craft a temporary table to collect the strings first)
Current implementation: str= str..whatever
Question: does anyone know of the performance difference between
'table.concat' and regular appending?
'Programming in Lua' has a section on this..
Basically regular appending, as it currently is, in Lua is a BAD IDEA.. The
old string is just 'abandoned' when you make the new, longer, string. Then
the garbage collector has to come along and clean it up, which can either
cause loads of memory to be 'in limbo' or cause the garbage collector to be
Paul VPOP3 - Internet Email Server/Gateway