Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

speed up batch processing of files

Status
Not open for further replies.

infinitelo

Programmer
Mar 7, 2001
319
0
0
Im not sure vbscript is the write tool for what i have in mind. I need to extract some text from a large quantity of files, (already have process that will work) but due to the sheer quantity i am concerned about speed. as far as simple file reading is vbscript as fast as a other options?



if it is to be it's up to me
 
infinitelo,

From my experience, a compiled app will always be faster.

Depending on your environment, have used a freeware version of awk/gawk (ported over from unix).

Same goes for a grep ported to the DOS environment. Both are available off the web.

I suspect that this is not what you were looking for, and hopefully one of the others on this site will be of more help.

DougCranston
 
If 99% of a program's time is spent on disc access the speed of the implemented code will be academic. If the code ran at light speed you'll never get below that 99%.
 
deltarho, thanks, i wasnt sure if vb was just as fast at disk access as other options. im also going back to look at how many of the files ill actually need to acess as less is better in this case.


if it is to be it's up to me
 
One of the things that really slows down a VBScript is string concatenation. You don't always have a choice, but when you do you should avoid it.

For example:
Code:
strBuf = "XYZ," & CStr(lngA) & "," & strB & "," & strC & vbCrLf
objTextStream.Write strBuf
... will end up being slower than:
Code:
objTextStream.Write "XYZ,"
objTextStream.Write CStr(lngA)
objTextStream.Write ","
objTextStream.Write strB
objTextStream.Write ","
objTextStream.WriteLine strC
This becomes very noticeable if the script runs for a long time, i.e. processes a very large number of lines of text.

Other things to avoid include recalculating expressions within a loop, including (and perhaps especially) retrieving object references. Anything of this nature that remains constant during the loop should be assigned to a temporary variable, and that variable should be used within the loop.
 
thanks for the tip, ill keep that in mind when i write the routine to store the results.


if it is to be it's up to me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top