Remember I said I had a mysterious .5 second delay that randomly appears when I have to instantiate CMD.EXE? Well I've also been having problems for months with my anti-virus scans - they crashed every time. I was using BitDefender. When the license expired this past week I uninstalled BitDefender and installed Avast 6 (free version) instead. Well it crashed with every scan as well.
I had no other apparent symptoms - though I'm sure there were plenty that I was just missing.
Well any way, I ran CHKDSK /R /F (scheduled for next restart), and it found and repaired 3 files with corrupt clusters and marked as unusable 5 additional clusters.
The result - faster reboots, no more mysterious delays, and no more anti-virus scan crashes
Here are my revised timings for my Vista machine (same code and test cases as before):
Code: Select all
A V E R A G E T I M E ( s e c o n d s )
Size Lines runs Read1 Read2 Read3 Read4 Read5 Read6
~1k 24 10 0.04 0.05 0.05 0.05 0.07 0.08
~2k 48 10 0.05 0.07 0.07 0.07 0.12 0.12
~4k 96 10 0.07 0.11 0.10 0.11 0.20 0.20
~8k 192 10 0.12 0.17 0.17 0.18 0.37 0.37
~16k 384 10 0.20 0.31 0.32 0.32 0.71 0.72
~32k 768 10 0.36 0.58 0.60 0.61 1.41 1.42
~50k 1685 3 0.75 1.34 1.43 1.43 3.09 3.11
~100k 3370 3 1.45 2.67 2.98 2.98 6.31 6.35
~200k 6740 3 2.89 5.31 6.59 6.65 13.28 13.32
~400k 13480 3 5.80 10.56 15.83 15.95 29.29 29.79
~800k 26960 3 11.50 21.07 42.43 43.02 69.43 70.11
~1600k 53920 3 22.94 42.23 128.49 130.93 182.75 184.90
The timings are all very consistent for a change. For example, whereas the 1k Read1 test used to take either ~.10 or ~.6 seconds, it now consistently takes .05 seconds. The results are also much more linear for small file sizes. I don't know if this improvement is because of CHKDSK or because AVAST monitoring is less resource intensive than BitDefender.
The methods still sort in the same order as far as performance. But these tests show a more pronounced impact of the addition of the pipe to Read2 vs. Read1.
But this is puzzling because Read5 (FINDSTR) and Read6 (FIND), have nearly identical timings. Yet Read3 (FINDSTR DO SET /P) and Read4 (TYPE | FIND DO SET /P) also have nearly identical timings even though Read4 has a pipe that Read3 does not.
These results still demonstrate non-linear behavior with the FOR /F ('command') construct when the outputs are large.
Dave Benham