ios - why does -openWithCompletionHandler so slow -
i have coredata database has 3 entities:"card", "record", "stat", "card" has 3000 objects in , "card" has no blob attribute (i know blob attribute may slow), other 2 entities has no objects.
i debugged on iphone4, when opening database, found quite slow,
here code:
nslog(@"database start open..."); [self.database openwithcompletionhandler:^(bool success) { nslog(@"copy & open success: %d", success); callback(yes); }];
here logs:
2013-05-13 13:11:54.776 suishoubei[1670:707] database start open... 2013-05-13 13:11:54.943 suishoubei[1670:1b03] coredata: annotation: connecting sqlite database file @ "/var/mobile/applications/850d8afd-ba6e-4e64-a150-507d5cd645fb/documents/default database/storecontent/persistentstore" 2013-05-13 13:11:54.950 suishoubei[1670:1b03] coredata: sql: pragma cache_size=200 2013-05-13 13:11:54.956 suishoubei[1670:1b03] coredata: sql: select z_version, z_uuid, z_plist z_metadata 2013-05-13 13:11:57.941 suishoubei[1670:707] copy & open success: 1
from coredata log, spent 3 seconds select z_version, z_uuid, z_plist z_metadata, , these fields , data managed corecode framework itself. , took longer(>10s).
i don't know why took long, , how make faster ?
thanks.
Comments
Post a Comment