Re: Need Help deleting record from text file
- From: "Mike Williams" <mikea@xxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Sep 2007 10:39:22 +0100
"Norm" <NormF4@xxxxxxxxxxxxxxxxx> wrote in message news:O9Y5x8JAIHA.748@xxxxxxxxxxxxxxxxxxxxxxx
Wow, What a difference, sorting and finding and displaying
the 10, 871 files takes only 3.7 seconds. It sure is a lot faster.
Thanks very much Mike,
You're welcome. That's about 30 times faster than your original code, so I assume you're quite happy with it. I suspect that there is still a fair bit of improvement still to be had though. Perhaps you might like to have a look next at the method you are using to get the list of files from disk. Presumably you're using the FindFirstFile and FindNextFile APIs [which is about the fastest you're going to get if you've coded it properly] but there is likely to be room for improvement in the string handling parts of that code [the parts that manipulate and / or return the file names]. On a second run [after the data is already in the disk buffers] you should be able to load 10870 filenames from the folder into a VB String array in less than a quarter of a second on most modern machines, so if that part of your existing code takes much longer than that amount of time then there is definitelty room for further improvement. Then you need to look at how you are displaying the list. Just inserting the file names from your String array into a VB ListBox for display purposes can take a couple of seconds, and if you need to display such a list so that the user can scroll throught it there are very much faster methods than a standard ListBox. However, whether you want to go to any more trouble over a couple of seconds is up to you of course, but it might be worth looking at. Overall, you should be able to get a list of your 10870 file names from the folder into a VB String array and then sort that array in a total time of about half a second on most modern machines, so that's the kind of speed I would be aiming for if I were you.
Mike
.
- References:
- Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Dave O.
- Re: Need Help deleting record from text file
- From: David Kerber
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Dave O.
- Re: Need Help deleting record from text file
- From: Mike Williams
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Mike Williams
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Norm
- Need Help deleting record from text file
- Prev by Date: Re: Need Help deleting record from text file
- Next by Date: Re: Need Help deleting record from text file
- Previous by thread: Re: Need Help deleting record from text file
- Next by thread: Re: Need Help deleting record from text file
- Index(es):
Relevant Pages
|