0

I've embedded the LuaInterface project into an application written in C# using .NET Framework 4.0. After compiling LuaInterface and Lua 5.1 I've referenced them in my application and created a Lua VM and exposed a few .NET classes. When the Lua VM doesn't make many calls, performance is not affected at all; but when it starts to call a larger number of .NET functions the entire application becomes slow and unresponsive.

In response to this, I've made an additional thread to run the Lua VM on. For some reason though, the thread on which the GUI is updated will not update while Lua is doing a function call, resulting in stuttering in the GUI. When moving a window around, you can clearly see that it doesn't respond for a little while, then moves, doesn't respond, etc.

How can I solve this issue? I was under the impression that giving Lua its own thread, a different thread shouldn't be affected? Is this purely related to my own code in some way, does LuaInterface have a huge overhead and what can I do to make it all better?

  • This is slightly cheecky, but could I refer you to here (http://stackoverflow.com/questions/3844057/loading-luainterface-in-net4) since I expect you know the answer I need! – Martin Oct 09 '10 at 21:42
  • Has anyone else encountered this slowdown? I am myself just starting to investigate Lua... – Ted Nov 12 '10 at 02:50
  • it might be a non-lua related issue, such as, how you make calls from the gui (i.e. not asynchronously). Apart from that, switch to [NLua](https://github.com/NLua/NLua) as it might contain fixes that you need – Dmitry Ledentsov Jul 22 '14 at 12:17

0 Answers0