Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

I am really impressed.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Rain Dog   Members   -  Reputation: 136

Like
0Likes
Like

Posted 20 October 2004 - 10:45 PM

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";
}




Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3445

Like
0Likes
Like

Posted 21 October 2004 - 03:23 AM

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

#3 Lioirc   Members   -  Reputation: 142

Like
0Likes
Like

Posted 03 November 2004 - 09:26 AM

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



#4 xor   Members   -  Reputation: 516

Like
0Likes
Like

Posted 03 November 2004 - 10:06 AM

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?

#5 Rain Dog   Members   -  Reputation: 136

Like
0Likes
Like

Posted 03 November 2004 - 11:17 AM

it is an Angelscript script, not a c++ function




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS