Convert the floats to "int bits" before storing them, then convert
back from "int bits" when you read them.  Store the numbers as either
hex or decimal integers.

On Apr 14, 11:01 am, Paul <pmmen...@gmail.com> wrote:
> I've got a bit of code in an app that reads XML String input (from the
> SD Card), and creates Android Paths using this information.  This
> requires converting String values to float values so they can be fed
> into the Path methods.  For extremely large files, such as those
> containing several thousand entries, with each entry requiring
> potentially several dozen of these individual conversions, the process
> can really be expensive and I'd love to find a way to improve the
> performance, even incrementally.
>
> I've profiled this operation (it uses Float.valueOf(String)) and it is
> eating up a huge portion of the processing time, unsurprisingly.  As I
> am stuck with the String XML source data, and have to get floats so I
> can create Paths, I am looking for any suggestions for alternatives to
> this expensive conversion.  I have no experience with the NDK, but
> would it be worth investigating to see if a NDK-coded conversion
> routine would be more efficient, or is this the wrong tree to be
> barking up?
>
> Any suggestions welcome!
>
> Paul

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to