|
Ceres Wanderer
Joined: 25 May 2006 Posts: 88
|
Posted: Sun Oct 22, 2006 11:27 am
The power of Local variables! |
I have been doing some speed tests between zMud and CMUD and thought others might be interested in my findings.
Using the following alias in both clients:
Code: |
#alias TestSpeed {last=%secs;#LOOP 1000 {a=%i;#ECHO @a};#SHOW %secs-@last "=" %eval( (%secs-@last))} |
I then modified the script in CMUD to use Local variables such as:
Code: |
#alias TestSpeed2 {#local $last $a;$last=%secs;#loop 1000 {$a=%i;#echo $a};#show %secs-$last "=" %eval((%secs-$last))} |
These are the results for 5 runs of each variant (lower numbers are faster):
Code: |
zMud 7.21 | CMUD 1.11 | CMUD 1.11
| |(local variables)
====================================================
15609 | 9531 | 437
15265 | 9563 | 438
15672 | 9578 | 422
15469 | 9578 | 438
15453 | 9641 | 422 |
I was staggered by the results:
1. On average CMUD completed the operations in %60 of the time zMud did with the same script (1.62 times faster).
2. When using Local variables CMUD completed the operations in %3 of the time zMud took (35.95 times faster).
All I can say is WOW
I am a Local variable convert! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Oct 22, 2006 4:53 pm |
What really will blow your mind is that Zugg hasn't really done any optimizations to CMud yet. Once he gets serious about that, it'd be like the speed of thinking.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Oct 22, 2006 6:37 pm |
I think local variables are already pretty performance optimised. But there are plenty of other areas that are not optimised yet. Zugg has already posted similar performance tests and results BTW though.
|
|
|
|
|
|