Original Post
Hi here are some performance tests that i did today, i dont have real scripts to test it with, but i wanted to test it, so here they are This is with for(i=0; i<100; i++) (all TestFrameWork tests) ----------------------------------------------------------------- Timings at 10:09:57 Wednesday, October 06, 2004 ----------------------------------------------------------------- AngelScript X86 ASM Virtual Machine ----------------------------------------------------------------- ExecuteNext() took 12.35 milli secs (called 6,100 times) ExecuteNext() took 12.08 milli secs (called 6,100 times) ExecuteNext() took 12.23 milli secs (called 6,100 times) ----------------------------------------------------------------- Timings at 10:11:45 Wednesday, October 06, 2004 ----------------------------------------------------------------- AngelScript Normal Virtual Machine ----------------------------------------------------------------- ExecuteNext() took 37.14 milli secs (called 78,200 times) ExecuteNext() took 38.21 milli secs (called 78,200 times) ExecuteNext() took 38.74 milli secs (called 78,200 times) This is with for(i=0; i<100; i++) (all TestFrameWork tests and the testexecutescript in STEP_INTO ) ----------------------------------------------------------------- Timings at 10:34:55 Wednesday, October 06, 2004 ----------------------------------------------------------------- AngelScript X86 ASM Virtual Machine with STEP_INTO flag ----------------------------------------------------------------- ExecuteNext() took 136.43 milli secs (called 6,200 times) ExecuteNext() took 142.61 milli secs (called 6,200 times) ----------------------------------------------------------------- Timings at 10:31:31 Wednesday, October 06, 2004 ----------------------------------------------------------------- AngelScript Normal Virtual Machine with STEP_INTO flag ----------------------------------------------------------------- ExecuteNext() took 244.61 milli secs (called 83,600 times) ExecuteNext() took 236.91 milli secs (called 83,600 times) This is with in testexcutescipt for(i=0; i<1000; i++) { ctx->Prepare(main_function) ctx->Execute() // TestAsmVm.as } TestAsmVm.as script is int i; int n; void main() { i = 1; n = 1; o_stream(i, n); // output the values if(i == n) { i = 2; o_stream(i, n); } else { i = 3; o_stream(i, n); } if(i == 4) { i = 0; o_stream(i, n); } else { i = 1; o_stream(i, n); } } ----------------------------------------------------------------- Timings at 11:33:40 Wednesday, October 06, 2004 ----------------------------------------------------------------- AngelScript X86 ASM Virtual Machine ----------------------------------------------------------------- ExecuteNext() took 1.29 milli secs (called 1,002 times) ExecuteNext() took 1.29 milli secs (called 1,002 times) ExecuteNext() took 1.28 milli secs (called 1,002 times) ----------------------------------------------------------------- Timings at 11:31:45 Wednesday, October 06, 2004 ----------------------------------------------------------------- AngelScript Normal Virtual Machine ----------------------------------------------------------------- ExecuteNext() took 181.56 milli secs (called 54,011 times) ExecuteNext() took 116.85 milli secs (called 54,011 times) ExecuteNext() took 151.52 milli secs (called 54,011 times) look at this last test, this is more what i was expecting, and compare the times ExecuteNext() function is called, so you can add here the savings of the function call overhead, that was not included, as the performance was tested inside the ExecuteNext() function In the first test, thee are a performance gains of about 200% to 220% only, but keep in mind that most of the testframework tests are a single line script, but in the third performance where a more longer script is executed 1000 times in a row (a situation more like a real game, every frame) you see a big gain in speed The x86 asm vm is implemented in the as 1.8.2beta1, the plain vm was replaced with mine, no extra optimizations to the bytecode or the bytecode generator/compiler, that is why i expect the perfomance increase greatly impelmenting this X86 vm in the last AS, but this is hard as the library is currently in a state of high optimization from each release, and now focused on multithreating, and i dont want to focus on this as i expect to optimize the X86 vm a little more and gain like 10% more of speed, but i want to use the edi register to hold the bytecode_ptr, and in multhithreating this is not posible, if several scripts will run on parallel, on a single processor machine I think that will be better if WitchLord and i can sincronize this vm with the current release or wip, because updating it can be easier than trying to update to the last release, when releases are separated by a few days Best Regards, Lioric