2 Questions : LUA speed and requirements

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

2 Questions : LUA speed and requirements

Christophe Gimenez
Okay, that's me... Again ;-)


1) LUA speed

- Does the number of functions declared in a LUA file have an effect onto 
the speed of lua_callfunction() ? (is 1000 functions a lot ???)
- How to determine the amount of memory needed to load a LUA file ? (As the 
text file is converted to bytecode I think it's not the size of the file)


Reply | Threaded
Open this post in threaded view
|

Re: 2 Questions : LUA speed and requirements

Luiz Henrique de Figueiredo
>From: Christophe Gimenez <[hidden email]>

>1) LUA speed
>
>- Does the number of functions declared in a LUA file have an effect onto 
>the speed of lua_callfunction() ? (is 1000 functions a lot ???)

No.
Even if you use lua_call, which calls the function by name and thus calls
lua_getglobal, the time to locate the function should not depend on the
number of globals defined, because lua uses hashing.

>- How to determine the amount of memory needed to load a LUA file ? (As the 
>text file is converted to bytecode I think it's not the size of the file)

It should be roughly the size of the file output by luac on this file.
What do you need this for?
--lhf

Reply | Threaded
Open this post in threaded view
|

RE: 2 Questions : LUA speed and requirements

Christophe Gimenez
In reply to this post by Christophe Gimenez

-----Message d'origine-----
De:	Luiz Henrique de Figueiredo [SMTP:[hidden email]]
Date:	mercredi 15 mars 2000 19:01
A:	Multiple recipients of list
Objet:	Re: 2 Questions : LUA speed and requirements

>- How to determine the amount of memory needed to load a LUA file ? (As the 
>text file is converted to bytecode I think it's not the size of the file)

It should be roughly the size of the file output by luac on this file.
What do you need this for?

Because I tought about using several lua states. This could be used to attach one or more scripts to objects.

But I think it could be useful compared to a plain lua file for message handling but in that case memory usage is important to determine.