Re: Help reading structured binary files
- From: erewhon@xxxxxxxxxx (J French)
- Date: Wed, 20 Jul 2005 07:37:09 +0000 (UTC)
On 19 Jul 2005 16:04:47 -0700, "Robert Kilroy" <kilroy@xxxxxxxxx>
wrote:
>J French wrote:
>> If those files are fairly small then I suggest you read them into
>> something in one gulp.
>>
>> Any form of disk accesss is /very/ slow
>>
>> Personally I would read it into a String, then probably use a
>> pre-created TStringStream
>I thought about doing something like that. And I think that'd work well
>if I knew the lengths of each value.
You know the length of each file
>And I'd have to open them up each
>time to read them anyway, so I am not sure the disk access would really
>be reduced that much.
You would be very surprized
- just reading a few bytes from a file on disk makes the OS do a heck
of a lot of work
>What I have seems to work fine, but yesterday I was given 700+ of these
>critters to import. It took a little over 30 seconds to process them
>and build the query. Much better than my original routine, which took
>close to 10 minutes. So I think we're fine. However this is a pilot
>project, and the number of files could dramatically increase. But the
>boss is happy and that's all I care about. :)
>Thanks much to everyone who helped, I really appreciate it. Keeping my
>ass out of the fire is always a worthy goal.
Changing your code so that it uses a Memory Stream of some sort is
pretty trivial
- I strongly recommend that you try it
.
- Follow-Ups:
- Re: Help reading structured binary files
- From: alanglloyd@xxxxxxx
- Re: Help reading structured binary files
- References:
- Help reading structured binary files
- From: Robert Kilroy
- Re: Help reading structured binary files
- From: Bruce Roberts
- Re: Help reading structured binary files
- From: Robert Kilroy
- Re: Help reading structured binary files
- From: J French
- Re: Help reading structured binary files
- From: Robert Kilroy
- Help reading structured binary files
- Prev by Date: Re: change the color of shapes created at runtime
- Next by Date: TBitmap memory allocation
- Previous by thread: Re: Help reading structured binary files
- Next by thread: Re: Help reading structured binary files
- Index(es):