I have been pulling my hair out on this one, but have narrowed it down. I was writing a large stream of data to a binary file under Windows Vista 64 with Trend Micro Internet Security virus suite and noticed unusually long delays in my code at times. I started placing MsgBox's in various parts of the code so that I knew where it was and found it to be the Close statement that was taking a long time. BUT: only when hyphens were present in large number in the written data stream.
Does this make sense? Why should the data stream matter?
Here's a test snippet:
If I build and write the string with hyphens it takes roughly 27 seconds for the file operation to complete (most of the time on the Close statement). If I build and write the string with spaces instead, it only takes 5.5 seconds for the same block of code to run.
I haven't tested this on other machines yet, but intend to. If you have a chance give it a shot on yours. I tried the code above with both PBWin8 and PBWin9 with the same results. I am guessing it may be the virus scanner, but have not made that conclusion just yet. I figured I'd let a few others see if they had similar results.
If you run this please show times for hyphens vs. spaces and your OS and virus software (if any).
Thanks!

Here's a test snippet:
Code:
#Compile Exe #Dim All Function PBMain Local idx As Dword Local blob As String Local tt As Double ? "Begin Build" ' blob = Repeat$(20971520, "Repeated-String-") ' Build 320 MB String This string takes 27 seconds blob = Repeat$(20971520, "Repeated String ") ' Build 320 MB String This string takes 5.5 seconds ? "End Build: Len = " & Format$(Len(blob)),,"Len(blob)" ? "begin write file" tt = Timer Open "blob.dat" For Binary As 1 Put$ 1, blob Close 1 ? "done in " & Format$(Timer-tt, "0.000") & " seconds." Kill "blob.dat" End Function
I haven't tested this on other machines yet, but intend to. If you have a chance give it a shot on yours. I tried the code above with both PBWin8 and PBWin9 with the same results. I am guessing it may be the virus scanner, but have not made that conclusion just yet. I figured I'd let a few others see if they had similar results.
If you run this please show times for hyphens vs. spaces and your OS and virus software (if any).
Thanks!
Comment