At 12:40 AM -0700 1999/04/12, Christopher Hunt wrote:
>Can anybody tell me if DmResizeRecord always resizes i.e. if I pass it
>in a record size of n whereby the record is already of size n, is there
>a performance price to pay other than for the comparison?

The short answer is YES, however, it really depends on how you keep track of the size 
of the record (specifically, when to resize it).

There is overhead whether the handle size changes or not (e.g. obtaining the database 
semaphore, checking the access mode, getting the record pointer, incrementing the 
modification counter, etc.) Checking the handle size first also incurs most of this 
overhead, and in cases where it is different, the worst-case overhead (nearly double).

So it becomes a trade-off in the design of your application. If the probability of a 
handle changing sizes is greater than the probability of it remaining the same, then 
just go ahead and call DmResizeRecord without regard. But if the opposite is true, 
then you should avoid calling DmResizeRecord altogether (when the handle size remains 
the same).

The optimization is really in knowing when it changes.

Hope that helps...

Jim Schram
3Com/Palm Computing
Partner Engineering

Reply via email to