|
Greendale Beginner
Joined: 19 Mar 2004 Posts: 17 Location: Sweden
|
Posted: Fri Mar 26, 2004 8:34 pm
Changing a variable is "slow" |
I have a very complex auto curing/healing system and I have some small performance issues in PVP combat when output from the game gets spammy. I have an AMD 3200+ with 1 GB memory.
I ran some very simple benchmarks to find out what zMUD does fast and what it does slow, and I found that nothing comes close to taking as much time as changing the value of a variable.
This takes 30 ms:
#FILE 1 foo.txt
#LOOP 100 {#WRITE 1 abcdefghijkmnopqrstuvwxyz}
#CLOSE 1
This takes 15 ms:
#LOOP 100 {foo=1}
This takes 390 ms:
#LOOP 100 {foo=1;foo=2}
And that is with all my gauges, buttons, status bars and status windows disabled. If I have them enabled the last example takes 650 ms.
Is there any way to speed it up? |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Mar 26, 2004 8:49 pm |
You must still have a button or gauge that is not disabled. When you change a variable used in a gauge or button or status window then zMUD must update that item, and refreshing the display of that graphical item is what takes so long.
I just pressed <ESC> to get a default MUD window and did:
Last=%secs;#LOOP 100 {foo=1;foo=2};#show %eval(%secs-@Last)
and got 40 milliseconds. |
|
|
|
Greendale Beginner
Joined: 19 Mar 2004 Posts: 17 Location: Sweden
|
Posted: Fri Mar 26, 2004 10:10 pm |
Indeed, I must have missed one. In a fresh window I get 0 (or too low to measure) milliseconds.
There is no way that you can restrict the refresh so that it only happens when a variable used for a gauge/button/status changes? Though I guess that could get tricky, for example if you want to be able to use a function as the value for a gauge. |
|
|
|
|
|