Skip navigation.
 
mlRe: Table View Blues
FROM : Alex Rice
DATE : Mon Nov 18 20:14:17 2002

On Monday, November 18, 2002, at 05:43  AM, <<email_removed>>
wrote:
> Yes, this is very cool, but it's not on the upside that the problem
> occurs. We all know we have to get the data in there. What we cannot
> afford is a haphazard memory arrangement so we're spending as much
> time getting rid of it later.


Someone suggested to me off-list that NSTableView might not retain
objects it gets from the NSTableDataSource. If that's true then the
bottleneck is completely in the data source implementation and has
nothing to do really with the table view itself.

If your data has 1M rows, don't create 1M NSStrings when the data
source object is created, as the previous loadTableDataFromFile:
example would do. Instead create the NSStrings lazily.

The tableview will only request objects from the data source _when it
needs to display them_. The user can view at most 100 or so rows at
once, and there is no problem creating 100 NSStrings it won't even be a
noticable hit creating them every time the user scrolls. Actually only
1 NSString would be created each time your
tableView:objectValueForTableColumn:row: is called. Something like this:

- (id)tableView:(NSTableView *)aTableView
    objectValueForTableColumn:(NSTableColumn *)aTableColumn
   row:(int)rowIndex
{
   NSString *answer = [NSString stringWithCString:
           someReallyFastFnToReadCSVData( rowIndex, [aTableColumn identifier]
)];
   return answer;
}

If you implement it this way I suspect your performance concerns will
disappear. I might try this later on because I am curious :-)

Alex Rice <<email_removed>>
Mindlube Software
http://mindlube.com/
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlTable View Blues Rixstep Nov 18, 06:28
mlRe: Table View Blues Alex Rice Nov 18, 08:54
mlRe: Table View Blues Alex Rice Nov 18, 09:11
mlRe: Table View Blues Andreas Mayer Nov 18, 10:28
mlRe: Table View Blues <rixstep000 Nov 18, 13:43
mlRe: Table View Blues <rixstep000 Nov 18, 14:10
mlRe: Table View Blues <rixstep000 Nov 18, 16:27
mlRe: Table View Blues Alex Rice Nov 18, 20:14
mlRe: Table View Blues Andreas Mayer Nov 18, 22:07
mlRe: Table View Blues j o a r Nov 18, 22:49
mlRe: Table View Blues j o a r Nov 18, 23:34
mlRe: Table View Blues David Remahl Nov 19, 00:23
ml[OT] Re: Table View Blues Terrence Asselin Nov 19, 01:39
mlRe: Table View Blues Kevin Elliott Nov 19, 18:27
mlRe: Table View Blues (summary) Alex Rice Nov 19, 19:16
mlRe: Table View Blues Clark S. Cox III Nov 19, 22:20
mlTable View problems with attributed strings Rosyna Nov 20, 07:25