[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade)
- From: Tim Hill <drtimhill@...>
- Date: Thu, 27 Mar 2014 14:38:36 -0700
On Mar 27, 2014, at 12:56 PM, Coroutines <coroutines@gmail.com> wrote:
>
> I was making a point that sometimes large realloc()'s to truly move
> strings together in memory (concatenation) can be bad :> Seems like
> for the usual small string the complexity and potential for cache
> misses are worse, though.
>
Agreed. It will, of course, temporarily need N*2 bytes of space for a final string length of N bytes. The nice thing about the PiL algorithm is that, since input strings can be discarded as the “tower” is built, the maximum memory consumed *during* concat can be significantly less.
—Tim
- References:
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Hisham
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Rena
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), William Ahern
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Andrew Starks
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Dirk Laurie
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Oliver Kroth
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Oliver Kroth
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Coroutines
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Sean Conner
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Coroutines