Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Ceres
Wanderer


Joined: 25 May 2006
Posts: 88

PostPosted: 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 Laughing

I am a Local variable convert!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net