Re: [luabind] LUA profiler and luabind performance
Brought to you by:
arvidn,
daniel_wallin
From: Dmitriy I. <ias...@gs...> - 2005-06-14 17:50:53
|
Hello, DI> we've implemented simple LUA profiler using LUA and found an DI> interesting thing : a lot of time is used by the unknown C function DI> (i.e. its string description is empty) During investigation of this DI> spy function we found that each access to the "self" variable DI> generates call of this unknown function. Therefore several questions DI> arise : DI> 1. Can you associate with this function some reasonable class or/and DI> class instance debug information? (since, we found that even parsing DI> class method generates that call) DI> 2. 37% of the time being used by scripts they spend inside this DI> function - is it possible to optimize self usage from the C++ part? DI> 3. Is there any techniques which can make our LUA code more optimal? DI> We tried to declare local variable and assign self to it, but it DI> didn't help. How can we reduce the number of accesses to self? There is a question about luabind::detail::class_rep implementation. file luabind/detail/class_rep.hpp .. line 368: // datamembers, some members may be readonly, and // only have a getter function std::map<const char*, callback, ltstr> m_getters; std::map<const char*, callback, ltstr> m_setters; .. What is the reason in using so inefficient structure for the members which are used so often? Is there any drawbacks in using native LUA tables instead, which are greatly optimized for strings? Each access to class instance like "self.a = 1" contains at least two searches over that map, i.e. several string comparisons, which are not fast for sure. -- Best regards, Dmitriy mailto:ias...@gs... |