• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: reading (parsing) CSV (or Excel) data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading (parsing) CSV (or Excel) data


  • Subject: Re: reading (parsing) CSV (or Excel) data
  • From: "I. Savant" <email@hidden>
  • Date: Fri, 2 Oct 2009 09:10:56 -0400

On Oct 2, 2009, at 7:42 AM, Mike Abdullah wrote:

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.


Very good to know, thanks, Mike. You might want to post a comment on the macresearch.org page so Drew can adjust the example.

Do you happen to remember what percentage of difference you were able to achieve? It's fine if not - it's not too difficult to set up a test. :-)

--
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


  • Follow-Ups:
    • Re: reading (parsing) CSV (or Excel) data
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >Re: reading (parsing) CSV (or Excel) data (From: Greg Guerin <email@hidden>)
 >Re: reading (parsing) CSV (or Excel) data (From: Colin Howarth <email@hidden>)
 >Re: reading (parsing) CSV (or Excel) data (From: Mike Abdullah <email@hidden>)
 >Re: reading (parsing) CSV (or Excel) data (From: "I. Savant" <email@hidden>)
 >Re: reading (parsing) CSV (or Excel) data (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: possible bug in webView big and small load sizes...
  • Next by Date: Re: reading (parsing) CSV (or Excel) data
  • Previous by thread: Re: reading (parsing) CSV (or Excel) data
  • Next by thread: Re: reading (parsing) CSV (or Excel) data
  • Index(es):
    • Date
    • Thread