• Advertisement
Sign in to follow this  

I am really impressed.

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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


Share this post


Link to post
Share on other sites
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++.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement