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
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Thu Oct 22, 2009 12:37 am   

[3.10a] BUG: Searching with package editor causes lag.
 
This is a bug I've been experiencing for a while. It appears when you search within the package editor and there are no results, it will cause Cmud to lag severely. Even after you close the package editor, if you did not clear the search it will continue to lag. It appears that the lag only occurs while cmud is receiving text from the mud. Here's an example of me sending 12 commands through at a time on Aetolia with timestamps:

No search active:
Code:
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Testing
05:27:36p | Could you be a bit clearer?
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | I do not understand.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | Come now, you don't really mean that.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | Most perplexing.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | I don't quite catch your drift.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | I do not understand.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | Could you be a bit clearer?
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | I do not understand.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | Quit trying to confuse me.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | Quit trying to confuse me.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | Most perplexing.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>
05:27:36p | I don't quite catch your drift.
05:27:36p | <4521/4521h 3121/3121m 9320e 14505w <eb lr> <csdb>>


Search with matching results active:
Code:
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Testing
05:27:49p | Pardon me?
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | Come now, you don't really mean that.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | I do not understand.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | I don't quite catch your drift.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | Quit trying to confuse me.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | I don't quite catch your drift.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | Interesting.....
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | Your meaning eludes me.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | You've baffled me!
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | Your meaning eludes me.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | Your meaning eludes me.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>
05:27:49p | I do not understand.
05:27:49p | <4521/4521h 3121/3121m 9344e 14505w <eb lr> <csdb>>


Search with no matching results active:
Code:
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Testing
05:27:57p | Most perplexing.
05:27:57p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:27:58p | Quit trying to confuse me.
05:27:58p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:27:58p | I cannot fathom your meaning.
05:27:58p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:27:58p | Most perplexing.
05:27:58p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:27:59p | You've baffled me!
05:27:59p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:27:59p | Could you be a bit clearer?
05:27:59p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:28:00p | Most perplexing.
05:28:00p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:28:00p | I don't quite catch your drift.
05:28:00p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:28:01p | Quit trying to confuse me.
05:28:01p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:28:01p | Your meaning eludes me.
05:28:01p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:28:02p | Your meaning eludes me.
05:28:02p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>
05:28:02p | Quit trying to confuse me.
05:28:02p | <4521/4521h 3121/3121m 9360e 14505w <eb lr> <csdb>>


Notice that the first two examples all go through within a second, while the last takes 5 seconds to complete. I repeated this test several times to ensure that it was not due to lag spikes. Zugg, I'll go ahead and email you my package file.
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Thu Oct 22, 2009 12:54 am   
 
Also, if you're going to test it out on Aetolia, so that the environment is as similar as possible, I have an alias called 'cprompt' that will configure the prompt to match correctly.

Update: I was unable to reproduce this in a blank session. I would assume that the problem is either unique to my settings or it's related to package size.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Thu Oct 22, 2009 1:08 am   
 
hmmm i'm not reproducing this, tried in one very large package, and in the all tab, it seems like it's something in your package
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Thu Oct 22, 2009 1:43 am   
 
Trigger matching does not seem to be effected as there is no difference in Ctrl+Q test times. I run a rather large prompt trigger so my guess is it is the script speed being adversely effected.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Thu Oct 22, 2009 2:14 am   
 
try disabling your prompt trigger, and then repeating the test?

I can see if you've a nasty prompt trigger causing some lag if you get a buncha prompts in a hurry but don't know why filtering thou settings in the PE would slow that down a lot, maybe if your updating a lot of variables and the package editor is trying to update the values?
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Thu Oct 22, 2009 2:28 am   
 
The lag disappears when I disabled my two main prompt triggers, which makes sense seeing as they're the most complex triggers in my system. As to your suggestion about it trying to update, that would make sense except that it only lags when the search returns 0 results; If the search returns any results, then there's no issue.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Oct 22, 2009 2:36 am   
 
The Search feature is using the database "filter" system. Basically doing something like "SELECT * FROM Settings WHERE Script LIKE '%pattern%'". It sounds like SQLite has some overhead if this doesn't match any records in the database. There is little I can do about that.

My best guess is that your script is causing a variable to update, which then tells the database it needs to reapply the search query. You might try changing the Search query to only look for matches in the Name instead of the Name and Script value, which is the default. This will prevent changes to the variable value from causing the search filter to re-compute itself.

But in general, there will always be some amount of slowdown when viewing the Settings Editor while your scripts are updating in the background. The Settings Editor has some code to minimize the number of updates to the screen (like the treeview) as the internal database changes, but that is limited, and stuff like the search filter can certainly cause slowdowns.
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Thu Oct 22, 2009 2:54 am   
 
Changing it to name only seems to cause a small improvement. Perhaps a check box to not have it continuously update the search, or just in the case that nothing returns the first time? Minor lag is an inconvenience but this is causing me to be completely locked out of CMUD at times, as I'm not even able to disabled triggers or cancel the search. I definitely don't see this as a huge issue since it's pretty obscure and easy to avoid.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Oct 22, 2009 4:47 pm   
 
You might also try turning off the "Auto Update" option in the View menu of the Settings Editor. That turns off the auto-update that might be causing the slowdown when your scripts are modifying the variables.

Also, if your Prompt triggers are modifying variables, and you don't need those variable values to carry over when you close/restart CMUD, then make sure to mark the "Use Default" option for each variable. This prevents changing the variable from updating the database, which makes your scripts faster and might reduce the amount of database updating being done in the settings editor.
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