• 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 in text files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading in text files


  • Subject: Re: reading in text files
  • From: Marcel Weiher <email@hidden>
  • Date: Fri, 1 Feb 2002 20:16:29 +0100

On Friday, February 1, 2002, at 12:45 , jgo wrote:


I'll bite. What if the file were 160MB... or 1.6GB?

Memory map ( ...withContentsOfMappedFile) an NSData. Do not use NSString, do not use NSScanner.

Try to avoid generating your own copies of the individual data items, reference the orignal memory instead. Try to avoid writing into the mapped memory, as that will generate a private copy.

I am not sure if the VM subsystem recognizes sequential scanning. If not, there is madvise() or the equivalent Mach call to advise the kernel that you are scanning sequentially (allowing it to more easily discard pages you have just processed, which are otherwise very 'hot' and thus liable to displace more useful resident pages).

Marcel

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.


References: 
 >Re: reading in text files (From: jgo <email@hidden>)

  • Prev by Date: Multiple NSTextView in an NSScrollView -- if possible
  • Next by Date: Re: InputServer/Manager
  • Previous by thread: Re: reading in text files
  • Next by thread: Re: reading in text files
  • Index(es):
    • Date
    • Thread