|
Rugbystyle Wanderer
Joined: 07 Oct 2001 Posts: 71
|
Posted: Sun Oct 22, 2006 6:22 pm
[1.11] Confusion about compiled code |
I'm finding 1.11 to be very workable, so am finally transfering over all of my settings to CMUD rather than just testing - but now I'm noticing oddities:
The first time I run an alias after opening a session, it's extremely extremely slow, my cursor just flashes rapidly from hourglass to pointer for 1-3 seconds (depending on the size of the alias) - but after that first time slow down, running the alias thereafter seems to be normal zmud speed.
The code all compiles, so I'm not sure if CMUD is compiling the alias each time I open the session and run it for the first time, or what is going on there, however the first time slow down drastically affects using cmud for actual play.
Another thing is in the compiled code tab, whenever I use a reference to a variable in such as @test, in class contained within a seperate but enabled package, it will always list the session window as the class....
1212 VARREF @test <test> (class Avendar)
That's a clip from the compiled code from an alias in a seperate package "PersonalSettings" class "ItemSort". Maybe that "(class Avendar)" doesn't mean anything, but I was thinking that might be why all of my scripts that use an @variable reference run so incredibly slow the first time, while cmud figures out where the variable actually is located?
Well those are my theories, I understand it's a beta version and not optimized for speed - it's just that I don't have speed issues in the scripts other than the first time it runs which seems like an issue. |
|
_________________ |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Sun Oct 22, 2006 9:13 pm |
I seem to recall a previous post stated that the class which in your case is Avendar is the class it was first made in, it may have been moved from there or the class name may have changed since the variable was made. In any case if I recall correctly it has no effect.
|
|
_________________ Taz :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 23, 2006 7:42 pm |
Actually, with the VARREF command, the class is the name of the currently active class when the variable was created. It has nothing to do with the class that the variable is actually contained in. It is used to determine if the variable ID that was looked up at compile time is still active. For example, when you reference @test, CMUD first looks in the current active class. If that active class changes, then @test might be referring to a different variable than when it was compiled. So CMUD stores this info to determine if a new lookup of @test is needed, or if the compiled reference can be used.
And yes, your alias is compiled the first time it is used. For most aliases, this shouldn't be a problem. Maybe you can post your alias so we can look at see why it takes so long to compile. |
|
|
|
Rugbystyle Wanderer
Joined: 07 Oct 2001 Posts: 71
|
Posted: Mon Oct 23, 2006 8:07 pm |
Is there a way we could get an option to compile all settings when opening a session? I would rather wait 30 seconds or however long it would take to compile all of my settings, than have pausing slow downs while I'm playing that could drastically affect game play.
Code: |
#ALIAS test {#FORALL @allSpells {#VAR %i 0}}
|
allSpells having 54 items in its string list, takes 17.54 seconds to execute the first time. To .43 seconds thereafter.
It's not just one particular alias, it's every alias, trigger, and macro. Even basic things like #SHOW @variable cause a noticable brief pause. So with more complex aliases and triggers it's exponentially longer.
I'm on a 3ghz p4 with tons of ram, so I know it's not my computer. Could just be my settings file - but it was perfect in zmud. |
|
_________________ |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 23, 2006 8:34 pm |
I'd rather figure out what is wrong with your script. It should never take 30 seconds to compile anything. Compiling your scripts should not be noticeable. If it *is* noticeable, then something else is wrong and we need to fix it.
On my system, if I have an alias as simple as #SHOW @variable, I can't even time how long it takes to compile because it's so quick. So if even that is noticeable, there is a big problem somewhere in your file that we need to track down. Just because it was perfect in zMUD doesn't mean it's perfect for CMUD or that CMUD doesn't have a bug somewhere causing this. |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Mon Oct 23, 2006 9:11 pm |
I've noticed similar performance behaviour to Rugbystyle, but as I have so many settings firing all the time, it's difficult to track down. Especially as it seems to get a lot better after playing a bit (probably when various scripts have been compiled or something).
|
|
|
|
|
|
|
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
|
|