Re: [GD-General] Scripting Systems
Brought to you by:
vexxed72
|
From: Eero P. <epa...@ko...> - 2004-01-22 11:46:41
|
Alen Ladavac wrote: > From: "Eero Pajarre" <epa...@ko...> > >>For me GC has not been the main problem speed wise, and I do trigger >>GC each frame, so that I can minimize "real time" problems with it. > > > Interesting idea. It really must smooth the performance. Though I would > expect it to be slooow. It certainly does trash the cache big time, doesn't > it? > It might be just me not noticing it, but as I said it has not been a problem yet. I certainly have been "garbage aware" in my code, so I don't produce that much of it. Also my data structures at lua side are not that huge. The main objects are on C++ side and just referred from the Lua side, although I typically still have also a Lua table for each main object. > >>Profilers show the Lua name lookup as a spike in the curves, this might > > That's same thing that I heard before, and one of main reasons why we didn't > choose Lua for in-game scripting. I just couldn't find anyone who could > reaffirm that. > > >>Local variables them self AFAIK do not need the name >>lookup. > > That is good. However, any member variable/function access would do a name > lookup, right? > Yes, although the access is based on hashed arrays etc, and is quick. > > Out of curiosity, does the interpreter have a function table for > instructions? If yes, then I don't see how so much misprediction could > happen. :/ > The main loop is actually switch based, but I think that even with function table the main switching point would predict rather badly. Also there is some unpacking of parameters in the virtual machine, which also doesn't branch predict too well. Eero |