Murga-Projects Forums

Full Version: Tcc - Lua
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, since the exam-period is usually the period where anything is interesting, here another blurb.

I was thinking about the biggest disadvantage of interpreted languages like Lua is the speed. So I wrote a little test to compare a C routine passed from within Lua to tcc and have it run directly, and the same routine implemented in Lua directly.

It turns out that the tcc version is a whopping 16 times faster than the Lua version, so maybe it's of some use to people who need to write fast code for some tasks.
Another good thing about Tcc is that it should compile for all 3 platforms supported by MurgaLua (disclaimer: not tested myself), and it's really small (installed size on debian 446k).

Anyway, the simple testscript I used is here.
Hope it's of some use to anyone!

Greetz,
Jan-Pieter
i am interesting of tcc too,but when i meet some problem and i sent mail to the dev-maillist,they tell me they just treat it as a toy,and hope i choose gcc as a offical compiler
That's a real pitty, because such a small c compiler, even with it limitations compared to its big brother gcc, is really interesting I think...
yes,i think tcc is an very helpful tool for me,because i have no more requests.as lua was written by clean C,maybe tcc is a good tool for writting addons for lua interpreter
I'm also a big fan of tcc and even use it sometimes productively at work for small tasks - I'm not aware of an alternative if you need a working portable compiler on a memory stick.
If your main concern is execution speed, did you already have a look at luaJIT? In the one case I tried it, it gave me a performance boost of a factor 7. Then the difference to tcc executables (which are not very optimized machine code) is not that large any more, and to my mind the advantage of staying within one language (think about debugging!) in most cases clearly outweighs the gain in speed.
Reference URL's