I am really impressed.

Started by
3 comments, last by Rain Dog 19 years, 5 months ago
I started fooling around with some some scripts today, to determine for myself the speed at which they execute, and i have to say, i am REALLY impressed with the WIP4. This is the script i used and it executes in about 2 seconds. It results in 5 MILLION fact! calls and a total of 6 million function calls.. I think AS is really really fast now.

int sum1(int a, int b)
{
	return a+b;
}

int fact(int n)
{
	if(n>1)
		return n * fact(n-1);
	else
		return 1;
}

void main()
{

	for (int i = 0; i < 1000000; i++)
	{
		int sum = 0;
		sum +=sum1(sum,i);
		fact(5);
	}
	msgstr = "hello1";
}


Advertisement
Thanks :D

WIP5 is even faster. I optimized the C++ VM so that it is even faster than the ASM VM. The ASM VM can be optimized even more, but that hasn't been done yet.

Lioric, who wrote the first ASM VM, is also developing a JIT compiler, which should have a performance much closer to pure C++.

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

its good to see that :)

In the next weeks, i will take a look again to the VM and do some optimizations that i didnt include because i wanted the asm VM to be tested before that

And some big plans for AS2 ......

Lioric

Is that piece of code 'actually' compiled?

I mean, in most program i've created using the Visual C++ Toolkit 2003 free compiler with the /O2 optimization flag, when i do something like that(call funtions whose results aren't stored or displayed) the compiler just doesn't include the funtion calls.

Have you tried creating a big array to store the results of fact(), and the results of sum(), and displaying the results afterwards?
it is an Angelscript script, not a c++ function

This topic is closed to new replies.

Advertisement