Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Oct 2013
Offline Last Active Oct 23 2016 10:37 PM

Posts I've Made

In Topic: AngelScript execution speed?

23 October 2016 - 09:03 AM


How big is 'huge'? A while back I experimented with different compiler options to see just how much Angelscript added to the binary size. The library (VM + compiler) is around 700KB. Is that 'huge'?

I get a 1750kB file for a no-debug static lib (whereas Squirrel, which I happen to have compiled for another project, is a mere 431 kB).


A program that looks like this:

int main() { auto scriptengine = asCreateScriptEngine(ANGELSCRIPT_VERSION); return 0; }
...gives me a 1MB executable (stripped).


But don't get me wrong, I didn't mean to say Angelscript was bad. When saying "the only bad thing I can say about Angelscript", that was rather meant to indicate that I'm actually pretty happy with it, in particular with its speed (which was the "issue" in this thread) but also with the ease of use.


Somewhat bigger executable than I would ideally like, well OK, ... but you know, look at the size of some executables, and how much rubbish they load on top of that in DLLs! In that light, what's a megabyte.


Some office program from a well-known mainstream manufacturer which doesn't do anything but... text... (and doesn't even do it well) is so darn huge it wouldn't even run on a computer that is slightly older than 5-6 years. :)


@samoth, you can do some optimization checks with your compiler to reduce the size

for example, -o3 optimizes your code a little for you

and, something intresting:

i've compiled AngelScript without jit compiler and only with jit instructions and with bytecode optimization into the app, it executed the scripts faster, (i didn't attach a jit compiler into it)

this script:

void main()
for(auto i=-100000;i<=100000;i++)
cout<<"\nexecution success\n";
cout<<"the execution took "+GetTime()+" seconds\n";

it took 38.2324 seconds which is grate

In Topic: AngelScript execution speed?

22 October 2016 - 01:40 AM

and a suggestion for byte-code optimization:
in my idea, it would be good to be able to add callbacks for byte-code optimization for example like this:

void asIScriptEngine::addByteCodeOptimizationCallback(asByteCodeLoadOptimizeCallback*, asByteCodeSaveOptimizeCallback*);
and the loading and saving can be like this:
void (asByteCodeLoadOptimizeCallback*) (asEBCInstr instruction, asDWORD* byteCode);
void (asByteCodeSaveOptimizeCallback*) (asEBCInstr instruction, asDWORD* byteCode);
although that was something like a simple theory, and that was a suggestion

In Topic: AngelScript execution speed?

22 October 2016 - 01:18 AM

How much faster do you think AngelScript should be? 10% faster? 50% faster? Twice as fast? 10 times faster? :)


If you have any suggestions for how to optimize the code I would be very interested in hearing that. 


It's so funny (but also frustrating) when AngelScript is compared with Lua. I would love to have the resources that the team behind Lua has. You do know that Lua was invented back in 1993 by a team at a university and is still maintained by that same university (PUC-Rio in Brazil) and has actual investment money behind it? AngelScript on the other hand was invented by me in 2003 and is maintained by me with zero investment money? I've been working on AngelScript on my spare time for 13,5 years now. While some of the code has been contributed by community members it is practically a work done by a one-man-team. 


All things considered I think AngelScript is comparing quite well to other scripting libraries out there (including Lua). 


PS. Have you tried Blind Mind's JIT compiler for AngelScript? Perhaps it will allow you to get the performance you want.


AngelScript is easy to add to an application, and it has a syntax similar to C++, which i love and i'll use it
i've only showed my tests that i've done and the result, nothing else
at least when i've tryed the AngelScript with that JIT Compiler, it crashed the application
anyway, AngelScript is my favorite scripting language, although lua is faster (i appriciate your grate work that you are doing on AngelScript)
anyway, sorry

In Topic: AngelScript execution speed?

20 October 2016 - 08:38 PM

ok, i don't know why lua is so fast, with a simple syntax and 100 kb of interpreter, which is only in ansi C (luajit as far as i know, turn's the code into asm which make's it so fast)

but anyway, for fibonacci, the AngelScript is a little bit slow (i don't want to compair it with c because c work's completely different from AngelScript and it is compiled to native code, not byteCode)

i think, AngelScript's byteCode must be optimized more

In Topic: AngelScript execution speed?

20 October 2016 - 04:56 AM

no, i not mean that, i mean AngelScript is slower than it should be