I've taken a different approach again Bob.
I store multiple records in one record chunk, and have written code to
deal with the access.
I win on database speed, the increased number of records allowed and the
reduced psuedo record overhead.
I was going to store 25 byte records, but found it just to painful to
create 1000 of them. So now, I store 100 'entries' or
psuedo records per chunk. Each chunk has an offset table, allowing me
to have variable length 'entries', as I would have had in a normal
database/
Change a few access function names from GetRecordCount() to
GetEntryCount() etc, and you are away.
The really fun routine to write will be the Pack. All that resizing and
shuffling. Hmm.... I wonder how fast the DmWrite is?
I've been lucky in that any database I've had to make BIG (ie. 100,000
entries) have been readonly.
> -----Original Message-----
> From: Bob Ebert [SMTP:[EMAIL PROTECTED]]
> Sent: Saturday, April 22, 2000 1:51 AM
> To: Palm Developer Forum
> Cc: Palm Developer Forum
> Subject: RE: Installing a PDB file takes a lot of time
>
> At 7:33 PM +0200 20-04-00, Steve Austin wrote:
> >Ok, call it magic, but what is it really. Is the Handheld Manager
> >overrunning a buffer and reallocating a large chunk of memory?
>
> Exactly.
>
> There is a database header, which is essentially a big array with the
> handles of each record. As you add records, this array must grow.
> When it
> grows too big for the chunk it's in, the chunk must be resized.
> Resizing a
> really large chunk can take a long time, because you will probably
> have to
> compact the heap to make room.
>
> 14000 records, at 8 bytes per record (10 bytes for resources) is 109K.
> That's a really large chunk. Hmmm... actually, a database this large
> should be impossible, because you've gone over the 64K limit. It
> looks
> like you should not be able to have more than about 8100 records in a
> database. Once you hit that number, DmNewRecord will start failing.
>
> That could explain why this is taking so long after a while -- after
> the
> limit is reached, then next 6000 or so record transfers will fail,
> which
> probably takes some time to negotiate through the serial connection.
>
> The only solution I can think of is to use fewer records, or use
> multiple
> databases.
>
> --Bob
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palm.com/devzone/mailinglists.html
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html