🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Performance difference between Lua and Squirrel

Started by
0 comments, last by fagiano 19 years, 10 months ago
Hi! Does someone know if Squirrel's performance is better/worse than Lua's? I'm currently using Lua with Luabind but when I saw Squirrel it really made me think about switching to it. If the performance is good and there is a helper library for binding c++ code with it (similar to Luabind) I'll definitly switch!
Advertisement
As squirrel author I did some tests in the past.
Comaparing lua and squirrel performances is not very easy mainly because squirrel is refcounted while lua is garbage collected.
According to my tests Lua is about 20/30% faster in bytecode excution running small programs (for certain stuff squirrel is faster but on most of the test lua wins).
This happens because lua in small tests is not doing memory management at runtime, and if is doing it the amount of data to traverse is very small.
In the other hand, in a situation with a lot of static data loaded in the virtual machine and a constant amount of allocations and deallocations Squirrel wins due the fact that there isn't garbage collection, plus there are not performance hickups(I tested with about 7Mb like in Far cry).

Squirrel is faster on array operations due the native 'array' type(is a bit unfair :) ).

So, the point is, squirrel has linear/deterministic behaviour but looses some speed.
Lua is faster but you get hickups proprotionally to how much data you load in the vm.



and No squirrel doesn't have any C++ bindings library at the moment, anybody volunteers?
btw I'll ask my company if I can release the one I use in my game...

ciao
Alberto
-----------------------------The programming language Squirrelhttp://www.squirrel-lang.org

This topic is closed to new replies.

Advertisement