Re: reading (parsing) CSV (or Excel) data
Re: reading (parsing) CSV (or Excel) data
- Subject: Re: reading (parsing) CSV (or Excel) data
- From: Mike Abdullah <email@hidden>
- Date: Fri, 2 Oct 2009 12:42:09 +0100
While using this code in an experimental project I found the app was
routinely using 500+ MB of RAM. When measured with Instruments I
realised that every time you use a character set for string scanning,
Foundation internally copies it, presumably to ensure it has an
immutable object to work with. As a result, potentially thousands of
copies are being created, resulting in either:
A) Outrunning the garbage collector
B) Spending far more time allocating and deallocating character sets
than doing the actual scanning
Easiest solution is just to make a single copy yourself early on. Also
the docs for NSMutableCharacterSet do point out that it's inefficient
but don't really offer any detail.
Mike.
On 2 Oct 2009, at 12:02, I. Savant wrote:
On Oct 2, 2009, at 6:34 AM, Mike Abdullah wrote:
inefficient due to its use of NSMutableCharacterSet.
Could you expand on this? Once created and manipulated, what makes
it slow for string scanning compared to NSCharacterSet? I hadn't
heard this.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden