🎉 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!

How fast is AngelScript?

Started by
4 comments, last by WitchLord 19 years, 4 months ago
Hello, I'm hesitating now what script to choose for the game project: LUA, Java or AngelScript. I find AS very interesting in capabilities, syntax and implementation. The main thing is the OOP-desing of the script. I'm wonder how fast is AS at runtime? For instance, compared to LUA Script? Thank you, sorry for my English.
Lead programmer of Kiev game-developing company Abyss Lights studio
Advertisement
some tests have shown AS to be up to 50% faster than LUA
Quote: Original post by Rain Dog
some tests have shown AS to be up to 50% faster than LUA


Can you provide sources for that claim?

LUA can also be OO.
2Prozak
>LUA can also be OO.

Yes, I know. I've seen some realizations, but none of them
has inspired me to use LUA as OOP language. =)

For instance, I failed to implement extension of C++ classes
with LUA pseudo-classes (tables).

Maybe I did something wrong, but I wonder how to implement such scheme:

// C++
class SomeBase
{
public:
void doSomething();
void eventCreate() { callSignal("onCreate"); } // This from my personal Lua VM

int somevar1;
};

// Lua, using tables
SomeDerived =
{
somevar2 = 100,
}

function AnotherClass:onCreate()
self.somevar2 = 150;
self.doSomething();
end;

I don't know how to force SomeDerived and SomeBase
to be in common scope, so that one could see another,
as if SomeDerived extends SomeBase.

Is it really possible?
Lead programmer of Kiev game-developing company Abyss Lights studio
the sources for these claims are in this message board.

I can't seem to find all of the initial test results, at first AS was considerably slower than LUA, but that is not the case anymore.

As of the latest 1.9.x version, AS was as fast or possibly faster in some cases than LUA, then in version 1.10.x witchlord began some hardcore work on optimizations and initially squeezed another 25% in v1.10.0, and eventually worked that up to 150% faster with the ASM VM, and later optimizations brought even the c++ engine to be 10% faster than the ASM engine. At that point, the ASM engine still has potential to be 25-200% faster than even the C++ engine at this point.


The following thread marks a list of changes for the 1.10.x WIP's, when reading these, keeep in mind that AS has been as fast as LUA since v. 1.9.2 or so.

http://www.gamedev.net/community/forums/topic.asp?topic_id=274740
I won't make any claims as to wether AS is faster than Lua or &#106avascript. I only know that since I learned that AS was about 50% slower than Lua (in one particular test) I've optimized the compiler and VM a lot. By interpolation AS 1.10.1 could be around twice as fast as Lua, but I haven't made any tests on my own to confirm this fact. AS 2.0.0 is slower than 1.10.1, especially when dealing with registered objects, but this difference is expected to decrease as I begin to optimize the code once more.

If you really need speed, then I think you need to look for a scripting language that support JIT compilation, which AS currently doesn't (though it might in the future). Otherwise I believe you should be looking at features as the principal factor in choosing which library to use.

I believe AS i currently the library that has the cleanest interface to C/C++ applications, as you can register normal C++ functions and classes with methods to be used from within the scripting language without the need for wrapper functions (except in some special cases). However, the script language itself is still lacking some features as it is still quite young (only 22 months in development).

The AngelScript language is not object oriented (yet), it doesn't even have the ability to declare structs yet. An application can register class interfaces that AngelScript can work with, but the script writer cannot derive from these interfaces themselves, and thus it is not possible to override the registered methods with script functions either.

I'm constantly adding features to AS though, and I'm quite easy to convince to add just the feature you want (if it is reasonable, of course). AS will soon allow structures to be declared and used in the script. After that I'll work on adding inheritance and polymorphism to make AS a true OO language (if possible, that is).

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement