lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Matthew P. Del Buono wrote:
> GrayFace wrote:
>> In this particular case of s..s the concatination shouldn't take much more
>> than Lim*2 time, where Lim is the limit of time a loop may take. At
>> least if
>> time/length dependance is linear enough.
>>
> 
> This would be a valid argument the increase of the string length were
> linear. However, it is not. The string length grows at 2^n, which is
> very far from linear.
> 

I apologize, I misunderstood your statement. I get what you mean now,
but it's mostly a moot point. The starting point is completely
arbitrary, and fact of the matter is it's possible to construct a
concatenation operation that takes an extremely long time. Point is, Lua
operators are not necessarily fast and negligible operations.

Regards,
-- Matthew P. Del Buono