Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sorting large tables




On 13 Mar '08, at 1:42 PM, Daniel Child wrote:

That makes a lot of sense to me, and that's the situation I'm trying to get to. But right now all I have is the original (unsorted) raw data. So I need to load it into memory and sort it.

You don't necessarily need to sort all of it at once. You just need to find the first few items, to display in your table view. If the user scrolls past those, you need to find more. You can do this by streaming the data from a file, keeping only the number of items you need in memory at once. This sort of task is typically called "external sorting", and Knuth and most other algorithm texts talk about it.


But that said, the sort you're doing shouldn't freeze or crash, not unless you eat up your processes' entire address space or use up so much VM that the system starts to thrash. You'll have to provide more details of what's happening.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: sorting large tables (From: Daniel Child <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.