mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
which one is the fastest?
i know i could set up tests for them, but i just need a quick answer
thanks

Joined: Mar 2004
Posts: 111
Z
Vogon poet
Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
good question, im intrested too blush, my guess is local var's would be fastest. but thats completely a guess.

Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
ive been messing around with hash tables a bit and theyre pretty fast!
im just not sure if the functions i write to check their status/read/write to them are slowing them down with local/global variables

Joined: Apr 2003
Posts: 342
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
Global (/set) varaibles are the fastest when it comes to a small amount of data. Then I assume local varaibles followed by hash tables. But if your working with a list of items or a lot of data that's stored in multiple places, then hash tables would be the prefered choice.

Really speed shouldn't be that much of an issue. It doesn't matter what fastest, just as long as the code is neat, clean, and functions.


Beware of MeStinkBAD! He knows more than he actually does!
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
nar i NEED efficiency
im reading portions from a massive apache access log file, and it takes about 5 minutes to read and format the whole thing
so my connection times out and i get disconnected

Joined: Apr 2003
Posts: 342
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
Well if it takes five minutes to parse the entire file, it really doesn't matter what you use... you won't cut down on the time needed to process. What you'll have to do is come up with a new approach.. I suggest these tips..

- Use /fopen, /fseek, and $fread for reading the file. This is probably pretty obvious but you never know...

- Try using regular expressions with /fseek.

- Use a timer to increment your way thru the file...

I parse a 2 meg XML file with 1500 entries eacb with ten values on average in just a few seconds with these techniques. It's much faster than that lame mIRC XML dll someone pointed me too. The important thing is to prioritize what you want to get done imeadiatly and what can wait...

Of course perhaps in your case you should try something else other than mIRC...


Beware of MeStinkBAD! He knows more than he actually does!
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
hey cool
i never knew there were these functions
thanks!


Link Copied to Clipboard