Re: VB slows down
From: Andrew Faust (afaust_at_aradymeDOTcom)
Date: 07/13/04
- Next message: Ken Halter: "Re: error = 430"
- Previous message: Bob Butler: "Re: Format of the value of constant: does it matter?"
- In reply to: Noelia: "Re: VB slows down"
- Next in thread: Jim Deutch: "Re: VB slows down"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 10:23:32 -0600
"Noelia" <Noelia@discussions.microsoft.com> wrote in message
news:902BA97C-E349-455E-9347-7F87F09F4F06@microsoft.com...
>
> Can you suggest another way of writing to file?
dim f as integer
f = freefile
open "c:\FilePath\FileName.txt" for output as #f
print #f, "Data"
close #f
> I still think the problem is the loops though.
Probably not unless this is running on a very slow computer. You
said in your first post that it should end
up with about 96,000 iterations. For modern computers this isn't
really all that large. I consistantly need to
work with loops in excess of 100,000 iterations, and don't find
any speed issues due to the loop. You can test
this by removing all the code from within the body of your loops
and seeing how fast they execute. It shouldn't be
more than a minute.
> In the beginning it processes and writes to file very fast.
This is because as files get larger and larger, it takes windows
more time to allocate more space for the file as the file
grows. One thing that I have needed to do in the past is to
estimate how large a file will be required, then to create
a file that large right to start with. You can then populate the
file as needed and truncate it down to size when you are
done (or grow it in larger chunks as needed.) I would try
replacing the FSO first, before trying drastic measures like
this, though.
Andrew Faust
- Next message: Ken Halter: "Re: error = 430"
- Previous message: Bob Butler: "Re: Format of the value of constant: does it matter?"
- In reply to: Noelia: "Re: VB slows down"
- Next in thread: Jim Deutch: "Re: VB slows down"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|