MemHandleLock slow for big records?

2003-12-29 Thread Richard Coutts
My database has typically 300 or so records where each records is from 100 byts to 65535 bytes long, with the typical size being around 10,000 bytes. The first 20 or so bytes of each record is a table that describes what's in the rest of the record, so when searching the database I often only need

Re: MemHandleLock slow for big records?

2003-12-29 Thread Keith Rollin
Rich, What happens when you incrementally take things out of the loop you show below? I'm wondering because searching through 607 records in my Address Book takes only a second or so on my Treo 600 when searching for my name. I figure it probably uses a loop similar to what you want, so perh

Re: MemHandleLock slow for big records?

2003-12-29 Thread SLO Revo News
recHandle = DmGetRecord(dbHandle, index); You can use DmQueryRecord (assuming you don't need to change the record). That should be a tiny bit faster. DmRecordInfo( dbHandle, index, NULL, &recID, NULL); No idea how much time this takes up. Is there some way to code around it? // do

Re: MemHandleLock slow for big records?

2003-12-29 Thread Julian Oh
You might want to rethink how you search the records, and binary search is your friend but your key will need to be sorted. I have a 15k records db and the average search is about, IIRC, 6ms. elv "Richard Coutts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My database has typ

Re: MemHandleLock slow for big records?

2003-12-29 Thread Richard Coutts
> What happens when you incrementally take things out of the loop you > show below? That was the problem -- other code was slow, not the record reading. I was jumping to conclusions. Thanks! Rich -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.

Re: MemHandleLock slow for big records?

2003-12-29 Thread Ben Combee
\I'm wondering if I'm doing something wrong or if there's a way to speed things up. To load the first 20 bytes of each record, I loop through and open each record like this: for (index = 0; index < numRecs; index++) { recHandle = DmGetRecord(dbHandle, index); Use DmQueryRecord here. It is a

Re: MemHandleLock slow for big records?

2003-12-30 Thread Luc Le Blanc
Ben Combee a écrit : > >\I'm wondering if I'm doing something wrong or if there's a way to speed > >things up. To load the first 20 bytes of each record, I loop through and > >open each record like this: > > > >for (index = 0; index < numRecs; index++) > >{ > > recHandle = DmGetRecord(dbHand

Re: MemHandleLock slow for big records?

2003-12-30 Thread SLO Revo News
What is the difference with DmGetRecord if after a Query, you can nonetheless write the record and release it? Only the Busy bit setting? Basically. Regards, Steve Mann -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Re: MemHandleLock slow for big records?

2004-01-03 Thread Flex
MemHandleLock is surprisingly slow function. I've benchmarked it many times and got awful results - it was a times slower than everything else in my program. I found no way to avoid it - even if I use the the handle as a pointer to pointer (and the value it points is the actual value I receive

Re: MemHandleLock slow for big records?

2004-01-03 Thread Richard Coutts
> MemHandleLock is surprisingly slow function. I've benchmarked it many > times and got awful results - it was a times slower than everything else > in my program. I found no way to avoid it - even if I use the the > handle as a pointer to pointer (and the value it points is the actual > value I r

Re: MemHandleLock slow for big records?

2004-01-05 Thread Flex
I suggest you do a shell or heap sorts - forget the bubble :) I've made some mix between them and optimized the logic and arithmetic - now 3 records are sorted in less than half a second on T|C :) Richard Coutts wrote: MemHandleLock is surprisingly slow function. I've benchmarked it many tim