Scripting and Performance

Started by
2 comments, last by deadalive 21 years, 1 month ago
I''m exploring scripting languages, specifically LUA and Python. I ''ve got them working and they seem really decent. But I''m wondering if there are performance issues/hits to consider when creating my engine. How much code can one consider reasonable to bind into these languages? Would it be inefficiant to have opengl or d3d bindings and write some of the engine in python?
this place is lame
Advertisement
Scripting is SLOW in compared to compiled code, obviously. You don''t want to control the drawing of on-screen objects in a script, for instance. It should be fast enough for logic, though. Also remember that languages like Lua have built-in (though controllable) garbage-collection so if you are creating objects in a script that runs every loop then you might have issues with that...a scripting language, though can add a whole lot of functionality and is worth the trouble, I think.
There are some libraries to write machine code on flipcode. You could make your own scripting language compile directly to machine code and it would probably be a lot faster than Lua or Python =-)
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Yeah, Extrarius is right ... although I must say that this is WAYS too much work to do ;-) ... I have developed several script compilers/interpreters on my own, and a virtual machine as implementation turned out to be efficient enough to handle even some time-critical parts with scripts, but still it is not as fast as it could be ... I thought that over a while ago, and I came to the conclusion that it was practically not worth the effort, because my code would have executed only 2-3 times faster ( estimated value! ;-) )
Anyways, using scripts is IMHO a good way to make your program more "open-hearted", as thehurricane suggested ... it is DEFINITELY worth the effort !!!


Indeterminatus

--si tacuisses, philosophus mansisses--
Indeterminatus--si tacuisses, philosophus mansisses--

This topic is closed to new replies.

Advertisement