> The code is basically a loop: skipping certain files (audio-visual and
> non-visible files), I process all the others basically in this way:
>
> //open the file as binary, false
> source = defineEncoding(b.read(b.length),nil)
> //parse it with Joe's TextUtilities
> mnumber = countB(Source, wordToBeSearched)
> //as soon as the word is found exit countB
> //add a row to a listbox (file name, location etc.)
>
Instead of using DefineEncoding, you should specify the encoding in the Read
call:
source = b.read(b.length, nil)
Otherwise, you produce 2 copies of every string just by reading it.
I'm not sure if that will make much difference, but it seems like you'd be
thrashing memory copying 4M strings over again.
Tim
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.7.3/1694 - Release Date: 9/26/2008
6:55 PM
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|