The functions SetScopeT() and ResetScope() apparently take quite the amount of time. I understand that lua-C++ interop is not a free ride, but I have 2 questions about it:
1) Apparently in SetScopeT(), using a const sol::table& parameter instead of a sol::table improves performance by a lot. Why though? Isn't sol::table a masqueraded reference by itself? Same goes by using sol::protected function& and _sol::protectedfunction elsewhere.
2) Is the method described above efficient or am I doing something unbelievably stupid for such a simple task? If so, what's the best (fastest) way to achieve it?
Hello, this is a technical question and not an issue. I hope it is acceptable to ask here!
In C++, I have a vector of sol::table stored:
At some point in my code, I want to assign one of these tables to a global table called "me" :
The functions SetScopeT() and ResetScope() apparently take quite the amount of time. I understand that lua-C++ interop is not a free ride, but I have 2 questions about it:
1) Apparently in SetScopeT(), using a const sol::table& parameter instead of a sol::table improves performance by a lot. Why though? Isn't sol::table a masqueraded reference by itself? Same goes by using sol::protected function& and _sol::protectedfunction elsewhere. 2) Is the method described above efficient or am I doing something unbelievably stupid for such a simple task? If so, what's the best (fastest) way to achieve it?