May. 28, 2023

Hello der,  Guest
Trader Name:
 | Home | Forum List | Active Threads | Search:
Page: of 1   
Script Feedback > Question towards EP....   
<< Thread >>

Joined: Apr 2005

posted: 02/22/2008 at 01:12 AM Post #1

Can commenting out a few client messages speed up a script?
I ask this because I'm using a modded version of turbosst and have gotten compliments on my cashing speed.
I will NOT go into details but my modded version seems to be able to out cash others.  And I was wondering if the extra stuff that TWX is sending to the client takes away CPU time from the script. 

If the above is true then I would believe that error checking can also cause a <I> slowdown </I> of scripts.

Joined: Jul 2006

posted: 02/22/2008 at 02:15 PM Post #2

I can answer this question.. but dang it, my initials are not EP.. 

sigh. oh well

The Joker's Always Smiling in Every Hand That's De

Joined: Jul 2006

posted: 02/25/2008 at 07:41 AM Post #3

Easy answer is: Yes.

If I'm not mistaken, TWX is not a multitasking program and executes a script "Top-Down". So any superfluous Code would 'slow' things down. That's a bit of a misnomer. TWX or the CPU isn't actually slowed down.. Bogged down is probably more correct.

Regardin Error Checking. Error checking absolutely slows things down; no ifs, ands, or buts about it.  Take the best example of this: Turning your ships IG off or on. The simplest 'script'/'macro':  Send "B Y "    ...that's a one line script.. and wold be very, very fast..  laff

First. Can you see what 'error checking' you'd need in with this amazingly super fast one-line script?  Here's a hint: What if you ran it from the computer prompt?  So. first obvious error check would be a Prompt Check. Now; what if your ship doesn't HAVE a IG?  you end up at the NavPoint Prompt.. hopefully you're getting the idea.

One of the major reasons to NOT make your stuff public is because of all the error checking that's required to make somethign 'user friendly'. You as a Scripter have to decide what's exceptable for error checking and weight the Pro's & Con's of sacrificing speed over safety.

One of my favorite examples of a situation where error checking should be employed but isn't, not in a single script in existance: Sub Space Msg's.  ... do you know what would happen if your Sub Space channel was set to -1, and your script tried to send some text over Sub-Space??  laff..  fun stuff.

edited by: LoneStar on 02/25/2008 at 07:42 AM

The Joker's Always Smiling in Every Hand That's De
TWX Development Team

Joined: Mar 2005

posted: 03/06/2008 at 08:17 PM Post #4

Apparently, I'm slow.  Sorry for the late response.

Everything that LS said is accurate, yet not necessarily relevant to sending client messages.  What you'll find when running turbosst is that your CPU is primarily dormant.  If you fire up Performance Monitor in Windows and monitor the right counters, you'll find that your memory page misses, disk queue depth, and your internet connection aren't being taxed anywhere close to becoming a bottleneck either.  So where does the bottleneck lie then?  You are limited by the TW server, which itself is limited intentionally, to better handle multiple client requests.  These are built-in delays so that one connection can't consume cycles to the exclusion of other connections.

If the sockets (and other resources) are primarily idle, then I don't see how sending or not sending client messages can make an appreciable difference to the speed of turbosst.  And in the case of clientMessage, that data is only sent between TWX and your telnet client (assuming you have no external users connected to your TWX Proxy), so I believe any cashing advantage is more likely due to lower latency in your internet connection, luck, or perhaps just from having me in your ICQ list. :)


Haggle Blog->
Script Feedback >  Question towards EP....
<< Thread >>
 | Home | Forum List | Active Threads | Search:
Page: of 1   

"why hello der matey! have a sit and buy me an ale, eh?" -- The Grimy Old Trader

The Grimy Trader is best viewed at 1024x768 resolution -- this page was generated in: 0.703 seconds.