|
|
|
Joined: Oct 2003
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 29 |
I currently have a mIRC script that I am developing (iRC iRCĀ©) and it uses around 20,000k of memory. This is the highest in my list of apps under Task Manager when sorted as Memory Usage.
What do I think should be done before the next release? I believe /echo is one of the highest used commands out of all of the other commands and needs to be fixed as well as others (maybe add the for function from the C language) to use less memory usage.
Where to Start? Make better use of /echo's colour argument by incorporating the $strip function to take out text that shouldn't be coloured and just be plain text. Also, It'd be great to use the for function from the C langauge instead of the While function.
Good job Khaled for 140,100+ lines of source code!!!
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
20MB is nothing for a modern application to use. Probably half of all applications I'm running right now are using 20MB+.
The echo command itself isn't what's using memory (beyond the tiny amount used to actually run it for the split-second in which it's executed), the window buffer of the echoed text is what uses it up. Autmatically stripping unnecessarily coloured text would save probably about a miniscule 100 bytes of RAM for the average mIRC user, and would then prevent the ability for that peice of text to be copied and pasted correctly into another window which then removes the default colour applied by /echo's colour parameter.
As for using for loops instead of while, I see no way in which that would save any memory whatsoever. If you mean that for loops should just be added because they're 'better' than while loops, they don't provide any speed benefits over while loops and don't even look cleaner, so what's the point?
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
Yeah 20mb isn't bad, I have around the same here while running a ton of scripts, on about 15 channels on 3 networks while just this one IE window is sitting here doing nothing at all at 30+ mb
Last edited by mIRCManiac; 30/04/05 12:55 AM.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
and don't even look cleaner I disagree. I think compact code looks much nicer (not including code separated with '|') so i'd much rather see a for loop than a while loop. for (var %i = 1, %i <= 20, inc %i) { echo -a %i }
New username: hixxy
|
|
|
|
Joined: Oct 2003
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 29 |
Yea, I wonder if the reason I am lagged is because I have the windows split so it displays the status window on the bottom and current channel or query window on the top. And, I should of also mentioned I am running a 266mhz laptop which makes a 20mb program hard to be run with any additional program (like Winamp or Visual Studio).
Good job Khaled for 140,100+ lines of source code!!!
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Really? var %i = 1
while (%i <= 20) {
echo -a %i
inc %i
}
[color:red]vs.[/color]
for (var %i = 1, %i <= 20, inc %i) { echo -a %i } Doesn't seem any cleaner to me, just harder to scan over quickly. And that's not even taking into account that a comma couldn't be used for the separator character for basic syntax reasons. It'd probably have to look more like this: for (var %i = 1 | %i <= 20 | inc %i) { echo -a %i } which is exactly what you just said you didn't like...
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
The , was just an example. I don't think using | in a for loop would be a big problem because a for loop barely never needs to be a huge line, unlike commands separated by |.
New username: hixxy
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
hmm my copy of 6.16 only uses 9,000k my copy of 5.91 uses 9,700k (it has a few more remotes loaded) my guess is that you have a lot of scripts loaded and maybe a lot of variables set.
|
|
|
|
Joined: Dec 2002
Posts: 252
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 252 |
i happen to use a toshiba tecra 550 cdt laptop with an intel pentium 266 mhz processor and 64mb of ram. my mIRC uses 4,944k in my task manager, and i run a boat load of scripts.. two of which happen to be socket related. a httpd and an ircd i have been designing. maybe its not the programs fault but maybe the coders fault? hehe. I also use my own dlls to "modify" the looks of mIRC which happen to be vb dlls using comopen and comclose. Yes i do have a more powerful machine, but this old, slow laptop is the way to go for mIRC scripting.. if you can make it run fast on a slow old laptop, imagine the performance on a much better one.
|
|
|
|
Joined: Sep 2004
Posts: 200
Fjord artisan
|
Fjord artisan
Joined: Sep 2004
Posts: 200 |
my bot uses around 2-3K of memory, my mIRC uses around 5K with a song playing. my bot has around 5 remotes loaded, 1 for ctcp, 1 for a core script which im still working on that incluses a few commands, 1 with 3 socket scripts in it, 1 for a !rec thing, and 1 for ns ghosting people when they connect to the network/change their nickname with a nickname i registered
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
2 to 3 k eh? what you write it in assembler? Did you mean 2 to 3 meg ?
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Lol! Reminds me of the old "demos" where you had to write a really interesting graphical/sound demo in 4k or 16k or 32k or whatever small amount the particular group wanted. They made some really awesome things back then in such little space. It's too bad those are not still done and are hard to find now.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Feb 2003
Posts: 307
Fjord artisan
|
Fjord artisan
Joined: Feb 2003
Posts: 307 |
Hello, Maybe it is time for you to start cleaning up your code... My script contains all the normal addons for protection and stuff, a web server running in real time, plays mp3 and has a seen system with 100k of users loaded. All in same mirc and only uses 15MB or Ram max, so i guess you must be loading lots of dlls or your are not cleaning your hashtables or something worst.
Or an easy option, you can also reduce the mirc window buffer from 5k to something less, maybe you have a bigger value than this uhmm?
|
|
|
|
|
|
|
|