Performance

Posted by WobblingEars on Sun 10 Feb 2013 06:36 PM — 6 posts, 21,426 views.

#0
Hi!

I have been scripting some with Lua and mini windows. I have noticed small delays in the text output from the mud because of my scripts.

I was just wondering if there is any way to prioritize the regular text received from the mud and let my script finish whenever it can - in a way to circumvent potential script delays.

Or are there any other ways to minimize the potential delays my scripting could cause?

Also any tips about optimization, benchmarking or performance are gladly appreciated! =)

Australia Forum Administrator #1
Are you calling the Redraw function? If you change a miniwindow's contents, but don't call Redraw, the change will be noticed next time the main window is redrawn, eg. when more data arrives from the MUD.
#2

Hi Nick!

Thank you for answering!

I have been fiddling with a mapper plugin of my own. In that I call WindowCreate again to "redraw" the map and it seems to be working just fine.

My issue is the other way around. Data arriving from the MUD seems to be waiting for scripts to finish before the text is displayed. Perhaps it only concerns using mini windows?

It's really not a big problem - the delay is very short. I'm just looking for tips on how to try to preserve the awesome speed Mushclient has while I'm adding my own plugins to it.
Australia Forum Administrator #3
You shouldn't need to call WindowCreate every time. There would be a bit of an overhead. Emptying the window (there is WindowRectOp for that) and then calling WindowShow (to force the redraw) should do it.

Quote:

Data arriving from the MUD seems to be waiting for scripts to finish before the text is displayed. Perhaps it only concerns using mini windows?


What text? Normal text is drawn as it arrives, as a whole line may not arrive at once. Then when the newline arrives all triggers are processed. Read more here:

Template:post=6554
Please see the forum thread: http://gammon.com.au/forum/?id=6554.


My own testing (plus using the Aardwolf version of the client) shows you can generally have a great deal happening at once with only minimal delays.

I think there are some tips in another thread about general optimization techniques.
Australia Forum Administrator #4
Read this:

Template:post=10279
Please see the forum thread: http://gammon.com.au/forum/?id=10279.
#5
Thank you very much!

Yes, I suspect the WindowCreate function is my culprit.

Great forum threads - just what I was looking for! =)