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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
dogotemn
Beginner


Joined: 05 Jul 2007
Posts: 21

PostPosted: Thu Jan 17, 2008 1:21 am   

Incredible CMUD Hang
 
quick question. is the #in the left column in the debugger time to process? if so i believe i've pinned this major hang in cmud to this block of code:

Trigger:

Code:
^~ ~ ~ ~ ~ ~ ~ ~ ~ (*)$


Code:
#if (@auc.read) {
  #addkey {auc@{auc.reading}} stat {%1}
  #if (((%pos("hps(",%1) AND %pos("mana(",%1))OR(%pos("hps(",%1) AND %pos("ss(",%1))OR(%pos("mana(",%1) AND %pos("ss(",%1))OR(%pos("hps(",%1) AND !%pos("hr(",%1))OR(%pos("hps(",%1) AND !%pos("dr(",%1))OR(%pos("mana(",%1) AND !%pos("hr(",%1))OR(%pos("mana(",%1) AND !%pos("dr(",%1)))AND!(%pos("AM",%1) AND %pos("AC",%1))) {#addkey {auc@{auc.reading}} class {%ansi(bold,magenta)C}} {#if ((%pos("hr(",%1) AND %pos("dr(",%1)OR(%pos("hps(",%1) AND %pos("hr~(",%1))OR(%pos("hps(",%1) AND %pos("dr(",%1))OR(%pos("mana(",%1) AND %pos("hr(",%1))OR(%pos("mana(",%1) AND %pos("dr(",%1)))AND!(%pos("AW",%1) AND %pos("AT",%1))) {#addkey {auc@{auc.reading}} class {%ansi(bold,green)F}} {#if ((%pos("wis(",%1) AND %pos("con(",%1))OR(%pos("wis(",%1) AND %pos("int(",%1))OR(%pos("int(",%1) AND %pos("con(",%1))) {#addkey {auc@{auc.reading}} class {%ansi(bold,yellow)L}} {#addkey {auc@{auc.reading}} class {%ansi(bold,white)*}}}}
  #if (%pos("AE",%1)) {#if (%pos("AN",%1)) {#addkey {auc@{auc.reading}} alignColor {bold,cyan}} {#if (%pos("AG",%1)) {#addkey {auc@{auc.reading}} alignColor {grey}} {#addkey {auc@{auc.reading}} alignColor {cyan}}}} {#if (%pos("AG",%1)) {#if (%pos("AN",%1)) {#addkey {auc@{auc.reading}} alignColor {brown}} {#if (%pos("AE",%1)) {#addkey {auc@{auc.reading}} alignColor {grey}} {#addkey {auc@{auc.reading}} alignColor {bold,yellow}}}} {#addkey {auc@{auc.reading}} alignColor {bold,white}}}
  auc.read = 0
  aucUpdate
  } {}
#state 0



so this used to execute quite quickly in zmud but it takes anywhere from 10 to 30 seconds to process on a dual core. any ideas?
Reply with quote
dogotemn
Beginner


Joined: 05 Jul 2007
Posts: 21

PostPosted: Thu Jan 17, 2008 2:02 am   
 
Ok actually, upon further investigation this particular trigger did not cause the lag. what DID was the state0 it was connected to which had a wildcard reference of %4 that did not exist... please submit this bug as it'll cause a LOT of headache upon typos in the future :P.
Reply with quote
dogotemn
Beginner


Joined: 05 Jul 2007
Posts: 21

PostPosted: Thu Jan 17, 2008 2:47 am   
 
ok i lied. i haven't seem to have gotten rid of the hang. here is the debugger output:

Code:
0.2035 | a       Med |***AUCTION:*** a large chunk of meat in slot A, minimum bid: 100, auctioneer: Vio.
0.0020 | f       Med |  Pattern: ~*~*~*AUCTION:~*~*~* (*) in slot (%w), minimum bid: (%n),... : (%1="a large chunk of meat", %2="A", %3=100, %4="Vio")
-8.2061 | c       Med |  exec : Pattern "~*~*~*AUCTION:~*~*~* (*) in slot (%w), minimum b...
2.1866 | a       Med |               Lev(0) Loc(None) NoBits Cond(pristine - 185 Days)
0.0021 | f       Med |  Pattern: ^(*)$ : (%1="               Lev(0) Loc(None) NoBits Cond(pristine - 185 Days)")
0.0075 | c       Med |  exec : Pattern "^(*)$" : #if (@auc.read) {   $s = %trim(%1)   #a...
3.2742 | a   auction |
0.0014 | a   auction |
0.0009 | a   auction |
0.0007 | a   auction |
0.0007 | a   auction |
0.0009 | a   auction |[A] OPEN *[a large chunk of meat                     ]$     100 0[100     ] 0          Vio(       -None-)
0.0013 | a   auction |[B] OPEN F[a glittering diamond                      ]$         0[999999  ] 0    Amorphiza(       -None-)
0.0014 | a   auction |[C] OPEN[the mirror of the ages                    ]$    .40m0[        ] 0        Zolox(       -None-)
0.0013 | a   auction |[D] SOLD[a black iron bustenhalt                   ]$    .10m0[.0)m    ] 2     Madmarok(     Eurodean)
0.0013 | a   auction |[E] SOLD[a green orb                               ]$    .40m0[.0)m    ] 1   Falconelli(       Aermac)
0.0018 | a   auction |
0.0026 | a       Med |


essentially those two triggers and a following alias add up to 7-10 or so seconds of lag. here are the printouts of the triggers:

TAG:
Code:
~*~*~*AUCTION:~*~*~* (*) in slot (%w), minimum bid: (%n), auctioneer: (%w).$


STATE0:
Code:
auc.hit = 1
#addkey {auc%2} mod 1
#addkey {auc%2} active 1
#addkey {auc%2} noLog 0
#addkey {auc%2} item {%1}
#addkey {auc%2} going {%ansi(bold,magenta)OPEN}
#addkey {auc%2} wasGoing 0
#addkey {auc%2} auctioneer %4
#addkey {auc%2} amount %3
#addkey {auc%2} bid 0
#addkey {auc%2} upbid 0
#addkey {auc%2} upbidNum 0
#addkey {auc%2} bidder "-None-"
#addkey {auc%2} time @time
#addkey {auc%2} lastUpdate @{auc%{2}.time}
#addkey {auc%2} stat ""
#addkey {auc%2} amountShort @aucShortMil(@{auc%{2}.amount})
#addkey {auc%2} upbidShort @{auc%{2}.amount}
auc.update = 1
auc.read = 1
auc.reading = {%2}
#state 1


STATE1:
Code:
#if (@auc.read) {
  $s = %trim(%1)
  #addkey {auc@{auc.reading}} stat {$s}
  #if (((%pos("hps(",$s) AND %pos("mana(",$s))OR(%pos("hps(",$s) AND %pos("ss(",$s))OR(%pos("mana(",$s) AND %pos("ss(",$s))OR(%pos("hps(",$s) AND !%pos("hr(",$s))OR(%pos("hps(",$s) AND !%pos("dr(",$s))OR(%pos("mana(",$s) AND !%pos("hr(",$s))OR(%pos("mana(",$s) AND !%pos("dr(",$s)))AND!(%pos("AM",$s) AND %pos("AC",$s))) {#addkey {auc@{auc.reading}} class {%ansi(bold,magenta)C}} {#if ((%pos("hr(",$s) AND %pos("dr(",$s)OR(%pos("hps(",$s) AND %pos("hr~(",$s))OR(%pos("hps(",$s) AND %pos("dr(",$s))OR(%pos("mana(",$s) AND %pos("hr(",$s))OR(%pos("mana(",$s) AND %pos("dr(",$s)))AND!(%pos("AW",$s) AND %pos("AT",$s))) {#addkey {auc@{auc.reading}} class {%ansi(bold,green)F}} {#if ((%pos("wis(",$s) AND %pos("con(",$s))OR(%pos("wis(",$s) AND %pos("int(",$s))OR(%pos("int(",$s) AND %pos("con(",$s))) {#addkey {auc@{auc.reading}} class {%ansi(bold,yellow)L}} {#addkey {auc@{auc.reading}} class {%ansi(bold,white)*}}}}
  #if (%pos("AE",$s)) {#if (%pos("AN",$s)) {#addkey {auc@{auc.reading}} alignColor {bold,cyan}} {#if (%pos("AG",$s)) {#addkey {auc@{auc.reading}} alignColor {grey}} {#addkey {auc@{auc.reading}} alignColor {cyan}}}} {#if (%pos("AG",$s)) {#if (%pos("AN",$s)) {#addkey {auc@{auc.reading}} alignColor {brown}} {#if (%pos("AE",$s)) {#addkey {auc@{auc.reading}} alignColor {grey}} {#addkey {auc@{auc.reading}} alignColor {bold,yellow}}}} {#addkey {auc@{auc.reading}} alignColor {bold,white}}}
  auc.read = 0
  aucUpdate
  } {}
#state 0



and then the alias: aucUpdate

Code:
aucSetColor
auc.change = 0
$s = ""
#forall "A|B|C|D|E" {
  #if (@{auc%{i}.mod}) {
    #addkey {auc%i} str {@{aucStr%i}}
    #addkey {auc%i} mod 0
    auc.change = 1
    } {}
  $s = {%concat( $s, @{auc%{i}.str}%cr)}
  }
#if (@auc.change) {
  #addkey auc str {$s}
  #window auction {%cr%cr%cr%cr%cr@auc.str}
  } {}


as you can see i do a lot of delayed references ie @{auc%{i}.str} to save myself writing 7 auction variables 5 times each for every slot (A-E).

i've played extensively with removing the state and %pos mayhem before and it made little difference. i think the real kicker on all this lag is the fact that i use many "expanded strings" to printout the display shown in the log. here is an example of one:

Code:
%ansi( @{aucA.color})~[%ansi( bold, white)A%ansi( @{aucA.color})~] @{aucA.going}~ @{aucA.class}%ansi( @auc.barColor)~[%ansi( @{aucA.alignColor})%left( @{aucA.item}, 42)%repeat( " ", 42 - %len( @{aucA.item}))%ansi( @auc.barColor)~]%ansi( bold, white)~$%repeat( " ", 8 - %len( @{aucA.amountShort}))%ansi( @auc.amountColor)@{aucA.amountShort}~ %ansi( %if( !@{aucA.wasGoing}, "grey", %case( @{aucA.wasGoing}, "bold,magenta", "bold,red")))@{aucA.wasGoing}%ansi( @auc.barColor)~[%ansi( bold, white)@{aucA.upbidShort}%repeat( " ", 8 - %len( @{aucA.upbidShort}))%ansi( @auc.barColor)~]%repeat( " ", 2 - %len( @{aucA.upbidNum}))%ansi( brown)@{aucA.upbidNum} %repeat( " ", 13 - %len( @{aucA.auctioneer}))%ansi( @auc.auctioneerColor)@{aucA.auctioneer}%ansi( @auc.barColor)~(%repeat( " ", 13 - %len( @{aucA.bidder}))%ansi( @auc.bidderColor)@{aucA.bidder}%ansi( @auc.barColor)~)



aside from the obvious "what's going wrong here?" question.. i guess i am wondering if there are better ways, procedurally, to go about getting these sorts of things accomplished? thx.
Reply with quote
dogotemn
Beginner


Joined: 05 Jul 2007
Posts: 21

PostPosted: Thu Jan 17, 2008 2:48 am   
 
erm state 2 is just a $(*) for a pattern, btw.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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