[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Does funtion & variable name lengths effect speed?
- From: Chris Marrin <chris@...>
- Date: Mon, 10 Oct 2005 11:31:43 -0700
Adam D. Moss wrote:
Posti Laatikko wrote:
Since lua is intepreted language i was wondering does variables &
names effect execution speed if names are long?
Nope - they're just strings which are interned and then
compared/hashed by pointer.
But technically a long string takes longer to do the initial hash,
right? So I can imagine a situation where a string must be interned at
runtime (constructed on-the-fly) and where you might see some runtime
performance issues for long strings vs. short strings.
With that said, Lua's string hashing function is awfully efficient, so I
think you would have to come up with a pretty unrealistic example to
notice the difference.
chris marrin ,""$,
firstname.lastname@example.org b` $ ,,.
mP b' , 1$'
,.` ,b` ,` :$$'
,|` mP ,` ,mm
,b" b" ,` ,mm m$$ ,m ,`P$$
m$` ,b` .` ,mm ,'|$P ,|"1$` ,b$P ,` :$1
b$` ,$: :,`` |$$ ,` $$` ,|` ,$$,,`"$$ .` :$|
b$| _m$`,:` :$1 ,` ,$Pm|` ` :$$,..;"' |$:
P$b, _;b$$b$1" |$$ ,` ,$$" ``' $$
```"```'" `"` `""` ""` ,P`
"As a general rule,don't solve puzzles that open portals to Hell"'