[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: patch: C-style string lexing
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 31 Jan 2008 18:03:57 -0200
> on 1/31/08 11:02 AM, Eric Tetz at erictetz@gmail.com wrote:
>
> > It's certainly no burden to *type*, but I think most programmers
> > find it unappealing to incur a performance penalty for the sake
> > of source beautification. If you've got 50 lines, Lua's creating
> > 48 strings of intermediate garbage just to concatenate them,
> > right?
>
> That's why we need constant folding in the compiler so that the compiled
> code only has one string.
Then the compiler will create 48 strings of intermediate garbage. If the
code in question is not executed repeatedly and it is not precompiled,
the net result is the same. (I suspect that this kind of code with
long strings is more frequent in initialization code that runs only
once.)
-- Roberto