Members - Reputation: 1277
Posted 03 November 2004 - 10:28 AM
Members - Reputation: 136
Posted 03 November 2004 - 11:19 AM
Lua: 20.499574 sec
AngelScript: 23.772902 sec 1.9.1-WIP1
1.9.2 = 10% faster = 21.47
ASM VM 50% faster = 14.31
1.10 final 10% faster = 12.8
new asm promises 25-50% increase in speed.
These are the results just extrapolated from the performance increases based on the different versions, and
do not promise to be correct, only a guideline from which to follow. As you can see, it thereby follows that AS is
now approximately 40% faster than LUA.
[Edited by - Rain Dog on November 3, 2004 5:19:24 PM]
Moderators - Reputation: 4363
Posted 04 November 2004 - 01:21 AM
This forum is quite new (it was created in March), so it's not so strange that you never noticed it before.
1. Yes, AngelScript can return objects. It will do this using a calling convention similar to that of C/C++. Unfortunately this means that it is a bit cryptic, since the application needs to pass a pointer to the memory that should receive the object. Here's an example code for that:
ctx->Prepare(engine->GetFunctionIDByDecl(0, "Vector3 TestVector3()"));
// Allocate memory for the returned object
// Note: The memory should be uninitialized
Vector3 *ret = (Vector3*)buffer;
// Pass the pointer to the memory as first parameter
// Note: This parameter is hidden and wasn't declared by the script
ctx->SetArguments(0, (asDWORD*)&ret, 1);
int r = ctx->Execute();
if( r == asEXECUTION_FINISHED )
// Use the returned object, or copy it to a more permanent location
// Call destructor on the returned object (only if the execution was successful)
I'm working on automatizing this, so that the application can simply call a function with the parameters it wishes to pass to the script.
2. As Rain Dog said, Lua was found to be almost 50% faster than AngelScript. I couldn't allow that of course so I have since worked hard on improving the speed of AS. Since version 1.9.0 AS has become between 2 and 3 times faster, depending on the situation. And there is still more that can be done.
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game