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
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Nov 12, 2007 11:25 pm   

[2.11] Var recompiled (String) - is this expected?
 
With the next timestamps, I can probably get rid of this variable, but even so, is the bolded part to be expected, or is slowing my scripts unnecessarily?

Quote:
0.0034 | Xxxx.mud |(05:09:19) ![ 2[0:2]>score
0.0097 | Xxxx.mud >score<CR><LF>
0.2299 | Xxxx.mud |200/200 hits, 120/120 mana, and 118/118 moves.
0.0063 | Xxxx.mud |Pattern: (%d)/(%d) hit{|s}, (%d)/(%d) mana, and (%d)/(%d) move : (%1=200, %2=200, 526.42 | %3=120, %4=120, %5=118, %6=118)
-526.-4062 | Xxxx.mud |
0.0034 | Xxxx.mud |![ 2[0:2]>
0.0011 | Xxxx.mud |Pattern: ^((.+))> : (%1="![ 2[0:2]", %2="![ 2[0:2]")
0.0075 | Xxxx.mud |[22] Var "PromptSub" changed from "(05:09:19) %line" to "(05:09:21) %line"
0.0058 | Xxxx.mud |Var "PromptSub" compiled (String) : (05:09:21) %line
0.0036 | Xxxx.mud =(05:09:21) ![ 2[0:2]>


PromptSub is supposed to be a string, like it was in zMUD, where %line is actually expanded and stored in the variable - this was the only reliable way of subbing my prompt. It does seem to work fine in CMUD even though %line isn't expanded though - I guess because %line is still valid when the #SUB happens. But the zMUD problems were only when there certain special characters in the prompt anyway. (05:09:21) is the current time.

Also note the incorrect delta on blank lines. I'll post a separate thread on that.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 12, 2007 11:47 pm   
 
Yes, CMUD does a simple check on a string variable to determine if it contains the % or @ character. If it does, then it compiles it so that it can execute the resulting code once and get the proper expanded value of the string. Something that simple should be pretty quick to compile though...really the same amount of time that zMUD itself would use to expand the string and concat the result together into a string value.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Nov 12, 2007 11:56 pm   
 
OK, it was only 6 milliseconds on that occasion too, although I have seen it take up to 0.0166 of a second. It would probably be less if I changed the variable to Use default though. EDIT: Hmm, no, not really - perhaps just less variation.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Nov 13, 2007 1:20 am   
 
Keep in mind that there is line-to-line variation in the delta time just from when the screen decides to update itself. For example, if your Refresh preference is set to 5 (the default), then CMUD refreshes the screen every 5 lines. Turn on delta times and do a Ctrl-Q test and you'll see that every 5th line has a higher time. When you are talking about the difference between 6 and 16 ms, that can often be just the refresh time difference.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Tue Nov 13, 2007 2:06 am   
 
I've never really understood that option. Surely the screen must refresh more than every 5 lines, or when you received 1 line, it wouldn't be displayed until another 4 lines arrived? Or does it also refresh when it detects a prompt?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Nov 13, 2007 3:42 am   
 
It also refreshes when it gets a prompt. So the refresh optimization only kicks in when scrolling a large amount of text. The idea was to improve speed, but still ensure that your eye would have a chance to see the text scrolling by. You can play with the Refresh preference to see the difference. Change it to 0 and it will *only* refresh when it gets a prompt (or end of network packet). Do Ctrl-Q and you'll only see the screen update once at the very end, and you'll see that the speed given is *very* fast. Then, change the Refresh amount to 1 to force it to refresh on every line. You'll notice that the scrolling is a bit smoother, but much slower. I have found that the default setting of 5 is a good compromise between these two extremes.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Tue Nov 13, 2007 3:56 am   
 
Ah, OK, that makes sense now. I'll give it a go then sometime.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Nov 13, 2007 4:59 am   
 
And what about such an example:
Quote:
...
07:54:35.500a | ***MUD*** | Button "btnSpellDetG" changed from "" to "detg;"
07:54:35.500a | ***MUD*** | Button "btnSpellDetG" compiled (Normal) : detg;
07:54:35.500a | ***MUD*** | Alias "detg" changed from "" to "cast 'detect good' @Myself;"
07:54:35.500a | ***MUD*** | Alias "detg" compiled (Normal) : cast 'detect good' @Myself;
07:54:35.500a | ***MUD*** | Var "Myself" changed from "" to "Arde"
07:54:35.500a | ***MUD*** | Var "Myself" compiled () failed : Arde
07:54:35.500a | ***MUD*** | Dir "n" changed from "" to "n|north"
...


P.S. Yeah, I'm aware of #CHAR command.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Nov 13, 2007 5:18 pm   
 
That is actually ok...I just need to remove that line from the debugger. Notice the (), that means there isn't any code associated with the variable. That means it's a literal value (like "Arde") and doesn't need to be compiled. So of course the compile fails for that case. In fact, it doesn't even call the compiler at all in that case. So I just need to prevent this from showing up in the debug log. Thanks for reporting it.
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