Terry,
What's the largest method you have coded?
Does it really matter? Size doesn't really matter here, the point I was
making is that the "length" of your method is really in the second method,
the first method is simply the loop & possibly the if. The second method has
all the code for the loop itself, allowing the second method to use Exit Sub
to go to the top (bottom really) of the loop...
But it seems as though I'm slowing
it down quite a bit with all the "jumping around".
Define "seems", I would use CLR Profiler or other profiling techniques to
actually time the loop & subroutines to see how will it performs or not
performs.
Remember the 80/20 rule (link below) that is 80% of the execution time of
your program is spent in 20% of your code. I will optimize (worry about
performance) the 20% once that 20% has been identified & proven to be a
performance problem via profiling (CLR Profiler is one profiling tool).
It goes out to about 30 servers (some on 56k and some on 128k)
downloads 30-100 log files from each
server (after telling the server to zip them up), then it unzips & parses
all those files to create an html page that displays the data from the
logs
Sounds like the ideal candidate for multi-threading!
As I would expect there is a lag connecting to each server, plus a lag
having each server zip its files, then another lag in downloading the files.
If you save the html pages to disk, there would be a lag there.
Multi-threading would allow your processor to work on another request while
its waiting for the lag...
I would define the routine that processed a single server as a subroutine, I
would then use System.Threading.ThreadPool.QueueUserWorkItem to queue each
request, to this subroutine. Where the Request includes a "State" object
with the server to process & other request specific info. This way a couple
of 128K servers will finish for each 56K server
Unless of course you have a single modem that is dialing each server, then I
would single thread the "download" part & consider multi-threading the unzip
& parse part...
For info on the 80/20 rule & optimizing only the 20% see Martin Fowler's
article "Yet Another Optimization Article" at
http://martinfowler.com/ieeeSoftware/yetOptimization.pdf
Hope this helps
Jay