mIRC Homepage
Posted By: Zabache 10% fast 90% slow - 18/07/13 06:55 AM
When using my remote script to data mine a large directory using $findfile, $ini, $readini and only one write and one echo line per read, mirc runs quickly through the first ten percent of the directory, reading several files per second, but once it has reached the ten percent mark, whether that be at 400 files, 800 or 1700 it slows to almost 1/3 its former rate for the duration and only reads one file per second after that. mirc or something has clearly hitting a wall... what wall? why 10% in each case? all ideas welcome and queries answered.
Posted By: Wims Re: 10% fast 90% slow - 18/07/13 09:46 AM
Could you please give us a sample of code you are using to come up with these stats? How many files are we talking about here?

Note: in case you didn't know, $findfile is a loop in itself, doing "var %a 1 | while ($findfile(dir,*,%a) != $null) { echo -a $v1 | inc %a }" is not proper and is indeed very very slow, because it has to reevaluate $findfile each time "noop $findfile(dir,*,0,echo -a $1-)" is proper.
Posted By: Zabache Re: 10% fast 90% slow - 18/07/13 11:30 PM
17k files in my search directory, and I'll spare you the code because after much work i resolved the problem to this conclusion... \+\ When reading this massive list of files, I discovered that this 10% slow down always occurred in a different location if i removed someone of the folders at the start of the directory, it would shift around and start a few files earlier based on how many i had removed. It eventually came to me that if the last directory was named \+\ as in D:\List\List\A\+\Filename.ini that the read rate of mirc would drop from > 3 per second to < one per second at the point it read from \+\ directory, and, ever after; turning a 30 minute $findfile routine into a 3 hour yawn. Seems room for improvement here. Otherwise fine work mIRC!

and, Could someone write me a while loop that illustrates a non-recursive $findfile... I use the following:

Code:
alias FasterPlease {
  var %1 = D:\List\List\, %2 = $findfile(%1,*,0), %3 = 1
  while (%2 >= %3) { var %fn = $findfile(%1,*,%3)

    inc %3
  }
}


and, what other non-recursive, fopen-like features might i be missing too? Faster is a huge help for my non-traditional uses of this fine coding environment.
Posted By: Loki12583 Re: 10% fast 90% slow - 19/07/13 03:09 AM
Your horrendous variable names aside, just as Wims said.

Code:
alias FasterPlease {
  var %dir = D:\List\List\
  noop $findfile(%dir,*,0,callback $1-)
}

alias callback {

}
Posted By: Zabache Re: 10% fast 90% slow - 19/07/13 04:03 AM
Hmm that is faster, thank you folks, another penny saved. And, common sense variables for common sense code I figure. I only name them where required by volume or posthumously after review, keep it simple I say. Thanks for the practical example it will help me muchly.


Are there any other non-recursives i should be aware of? and pardon my confusion in the earlier example but i have no idea what noop is?
Posted By: sparta Re: 10% fast 90% slow - 19/07/13 04:13 AM
Not much information, but anyway.

/help /noop

You can also use google to find out more.
Posted By: Zabache Re: 10% fast 90% slow - 19/07/13 09:28 AM
Code:
/zz {  }
/rp { $1- }

wink

thanks, i'll try it your way.
© mIRC Discussion Forums