In my application, I'm receiving a CSV
file that contains 30,000 objects and for each object there are always 24 values (a total of 720,000 values).
Format is something like this:
object1,value1,value2,...,value24
object2,value1,value2,...,value24
...
objectn,value1,value2,...,value24
When I parse this file, I convert each row in an NSArray
of NSString
.
Next I do the following for each value of the array:
- convert from
NSString
tofloat
using- (float)floatValue
- convert the
float
to anNSNumber
- store the
NSNumber
in anNSMutableArray
This process takes several seconds and from Instruments Time Profiler
I'm spending 3.5 s in step 2 & 3 for the 720,000 values.
How can I proceed to avoid the NSNumber
translation? Can I use a C style array, something like []
? Or CFMutableArrayRef
? If it helps, I know there are always 24 values for each object.
Thanks for the help,
Sébastien.