At 7:39 PM -0800 3/2/99, Alan Pinstein wrote:
>Got another idea. At boot time, why not allocate a block of 64 (or so)
>1-byte length records? I don't know what the speed tradeoffs between
>DmResizeRecord() and DmNewRecord() are, but it may be faster to resize a
>record than to allocate a new one, since some of the overhead is already
>taken care of...
Probably won't make much difference. Use the profiler or get the source
license and you can see what's going on inside. The DmNewRecord "overhead"
is mostly finding a free chunk in the storage heap. DmResizeRecord will
almost always have to find a new chunk if it's growing by any appreciable
amount, so you get stuck with the same overhead -- and increased
fragmentation because you're leaving small chunks behind.
>One other thing to consider (and I need someone from Palm to comment)... I
>remember from DevCon that there was some discussion about Records vs.
>Resources, and there were some speed differences in favor of resources for
>certain things... they may be applicable here (that is, DmNewResource() may
>be faster than DmNewRecord()).
Probably not. Again, the big hit is finding free space. By the way,
that's much more efficient in the 3.1 and later OS (the Palm V and Palm
IIIx), because there's a free list. See the memory manager article at
http://www.palm.com/devzone/docs/memarch/memarch3.html
--Bob