mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2015
Posts: 8
F
FRAG_B Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Apr 2015
Posts: 8
Hi,

I have a 'remote' script in my mIRC of which 285 lines apply to "ON *:TEXT:*:#:{", so the script executes them on every new textline if I'm not mistaken. I use IRC for a game server and we have hundreds of textlines every hour.

Now I was wondering if a script of such a size can have a notable negative effect on my computer's performance, or if mIRC will have a higher chance of crashing, etc. I'd like to know if it's okay to add more code to the script or if I better keep it as small as possible.

Last edited by FRAG_B; 01/04/15 08:55 PM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
It depends a lot on what your code is, the number of lines is not really relevant. You can write just a few lines of code that will be very taxing on mIRC's performance. For example, looping over a giant .ini file everytime someone writes anything will be a bad idea smile

If you have many instances of ON *:TEXT:*:#:{ you probably could have written in it better way. Don't know if that really makes a big difference, though.

I don't think mIRC will drag down your PC. You'd probably need to have A LOT of things loaded into mIRC's memory or your PC would have be very bad for that to happen, but I'm far from an expert on CPU and memory..

If you're very concerned about perfomance, and you need to do more demanding tasks, it's best to write your bot in a real programming language.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Additionally, it has very much to do with the activity in the channel or number of channels you are in. If you're processing On Text events for hundreds of lines spoken per second, with heavy amounts of string parsing, looping and manipulation for each, then you will certainly notice drag in performance.

One way you can measure and mitigate performance is to count the number of '$' symbols in your script. Most functions (identifiers) have to spawn a new stack, causing a bit of memory and processor flip-flop with each call. The more you can reduce '$' calls from your script, the less work mIRC has to do.

Case in point: If you're making dozens of $pos, $left, $right, $mid, $gettok calls on every line of text written, you can improve performance a hundred fold with a single smartly written $regsubex that does the same thing.

If you're performing dozens of $reads and /writes to the same file, then use /fopen instead for a 1000+ fold improvement.

If you increased your "Window buffer" setting from 5000 to 999999, you will notice your system begin to crawl after mIRC has been running a few days.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Apr 2015
Posts: 8
F
FRAG_B Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Apr 2015
Posts: 8
Thanks guys, that's good to know.


Link Copied to Clipboard