Single Status Update
Is there any simple explaination why using C++ to make game in Leadwerks can help performance better than lua? (Explain like I am five)
- Show previous comments 2 more
Your bottleneck is likely to be the graphics on the CPU or the GPU, in which case the language your game code is written in doesn't make a big difference. However, Lua involves GC pauses while C++ does not, and C++ runs much faster overall.
In Turbo your game logic has its own thread, which makes it okay to use Lua with VR even, and even GC pauses won't slow down the renderer.
Every C instruction corresponds to a very few assembler instructions. You are essentially writing higher level machine code, so you have control over almost everything the processor does. Many other compiled languages, such as C++, have a lot of simple looking instructions that can turn into much more code than you think it does (virtual functions, copy constructors, etc..) And interpreted languages like Java or Ruby have another layer of instructions that you never see - the Virtual Machine or Interpreter.