> > From: Kevin
> >
> > I have a commerical application that has run fine under
> > all 3.x version of PalmOS. Under 4.0 it runs very slowly.
> > I have not been able to pinpoint any particular API calls
> > that run slower. It appears as if the C code just runs
> > slower especially string manipulation and searching.
> > Anyone had a similar experience?
> >
>
>I think you'll find that StrCompare() and StrNCompare() are slower in the
>4.0 SDK.
StrCompare should be roughly comparable in speed, less the trap
dispatch overhead of calling through to TxtCompare.
StrNCompare will be slower in 4.0 - the longer the strings you're
passing in, the bigger the performance issue.
>If you are certain your app is running only on single-byte char sets with
>7-bit ASCII, then you could speed things up even more by using
>StrCompareAscii() and StrNCompareAscii() instead.
The Str[N]CompareAscii routine should only be used if the text you're
sorting is never displayed to the user - in that case you could use
it on any text (regardless of the character encoding), since it's
just doing a raw byte-by-byte comparison.
Otherwise, you want to use locale-specific sorting as provided by the
Txt[Caseless]Compare routine.
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/