Hi,

I'm working on a NSPersistentDocument based application. My data model is quite simple, the main entity contains a few strings, ints and dates and there is an array (one to many relationship) of another simple entity. The document window contains an NSTableView that displays all the main entities (using an NSArrayController) Everything seems to be working ok except that when I open a large document (20k records) for the first time in a session (after a restart), it takes a few minutes of spinning wheel for the data to show. If I close the document and then re-open I usually get an instant response. The format is sqlite. Following is an Activity Monitor sample taken during this long process. I also tried to monitor this using Instruments and saw nothing interesting - only one fetch.
I'm really stuck with this, I would appreciate any ideas or pointers...

Thanks in advance,


Eyal Redler
------------------------------------------------------------------------------------------------
"If Uri Geller bends spoons with divine powers, then he's doing it the hard way."
--James Randi
www.eyalredler.com





    1765 Thread_2507
      1765 start
        1765 main
          1765 NSApplicationMain
            1765 -[NSApplication run]
1765 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
                1765 _DPSNextEvent
                  1765 BlockUntilNextEventMatchingListInMode
                    1765 ReceiveNextEventCommon
                      1765 RunCurrentEventLoopInMode
                        1765 CFRunLoopRunInMode
                          1765 CFRunLoopRunSpecific
                            1765 __NSFireDelayedPerform
                              1765 -[NSInvocation invokeWithTarget:]
                                1765 -[NSInvocation invoke]
                                  1765 __invoking___
1765 -[NSController _controllerEditor:didCommit:contextInfo:]
                                      1765 _NSSendCommitEditingSelector
1765 - [NSObjectController(NSManagedController) _executeFetch:didCommitSuccessfully:actionSender:] 1765 - [NSObjectController(NSManagedController) fetchWithRequest:merge:error:] 1765 - [NSArrayController(NSManagedController) _performFetchWithRequest:merge:error:] 1765 -[_NSManagedProxy fetchObjectsWithFetchRequest:error:] 1765 - [NSManagedObjectContext executeFetchRequest:error:] 1765 - [NSPersistentStoreCoordinator(_NSInternalMethods) executeRequest:withContext:] 1765 -[NSSQLCore executeRequest:withContext:] 1765 - [NSSQLCore objectsForFetchRequest:inContext:] 1765 newFetchedRowsForFetchPlan_MT 1765 - [NSSQLiteConnection fetchResultSet:usingFetchPlan:] 1765 _execute 1765 sqlite3_step 1765 sqlite3Step 1764 sqlite3VdbeExec 1306 sqlite3VdbeMemFromBtree 1306 accessPayload 1306 sqlite3PagerAcquire 1305 pread$UNIX2003 1305 pread$UNIX2003 1 sqlite3PagerAcquire 455 sqlite3BtreeNext 455 sqlite3BtreeNext 455 sqlite3PagerAcquire 454 pread$UNIX2003 454 pread$UNIX2003 1 sqlite3PagerAcquire 3 sqlite3VdbeExec 1 sqlite3Step
    1765 Thread_2603
      1765 thread_start
        1765 _pthread_start
          1765 minion_duties2
            1765 _prepareRowsOnBackgroundThreads
              1765 pthread_cond_wait$UNIX2003
                1765 __semwait_signal
                  1765 __semwait_signal
    1765 Thread_2703
      1765 thread_start
        1765 _pthread_start
          1765 minion_duties2
            1765 _prepareFaultsOnBackgroundThread
              1765 pthread_cond_wait$UNIX2003
                1765 __semwait_signal
                  1765 __semwait_signal
    1765 Thread_2803
      1765 thread_start
        1765 _pthread_start
          1765 minion_duties2
            1765 _populateRowValuesOnBackgroundThread
              1765 pthread_cond_wait$UNIX2003
                1765 __semwait_signal
                  1765 __semwait_signal
    1765 Thread_2903
      1765 thread_start
        1765 _pthread_start
          1765 minion_duties2
            1765 _prepareRowCacheOnBackgroundThread
              1765 pthread_cond_wait$UNIX2003
                1765 __semwait_signal
                  1765 __semwait_signal

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        __semwait_signal        7060
        pread$UNIX2003        1759
Sample analysis of process 154 written to file /dev/stdout





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to