Click to See Complete Forum and Search --> : I need more speed Baby!
BrewGuru99
October 21st, 1999, 09:35 PM
What is faster?:
Searching for a word through multiple text files (Additionally which is faster: all the files in their own directories, or all in the same directory?)
or
Searching for a word through one file that is the sum of all the other files by stepping through it one "group" at a time?
Brewguru99
BrewGuru99
October 22nd, 1999, 01:48 PM
Hey? What? No takers?
Brewguru99
Bruno
October 22nd, 1999, 04:17 PM
The answer is - it depends. Single InStr can be a bit faster, but reading big file in memory can cause swapping, so it can be slower.
I think grouping files is not good idea.
Chris Eastwood
October 22nd, 1999, 05:36 PM
In addition to Bruno's post - you'll also find that using the VB 'Like' command is a lot quicker to see if a text string contains the text you're looking for than using InStr (although it only tells you if it's there, it won't give you a position in the text so you'll still need InStr).
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Bruno
October 23rd, 1999, 05:51 AM
Hey, excellent Tip. We VBers need more speed with strings and every Tip is welcome.
"Like" works great with case-insensitive searches - Instr is slow when vbTextCompare option is used.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.