[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Performance problems!
- From: Jamie Webb <j@...>
- Date: Wed, 25 May 2005 12:06:36 +0100
On Wed, May 25, 2005 at 03:12:25PM +0500, Zulfiqar Malik wrote:
> Calling this script 10,000 times takes apporx 906ms. However if I
> comment out the last line, then the script will actually be doing
> nothing, but it still takes up 828ms to execute the same number of times
> as before!!! This has led me to believe that the actual code execution
> is pretty fast, whilst the setup (parsing, although I heard that
> theoretically LUA will parse this file/string only once!) is taking all
> the time. Can someone help me get rid of this lag so that I can get on
> making a powerful material system. Lua_dofile is horribly slower so I
> resided to lua_dostring and lua_dobuffer. I have also tried
> pre-compiling the code using luac.exe but with only a slight performance
> gain.
dofile/dostring will parse the code each time. You need to use
loadfile/loadstring just once, and then call the returned chunk object
10,000 times.
-- Jamie Webb