简体   繁体   English

CloudKit上传非常慢

[英]CloudKit upload very slow

Does anyone have an idea if there is a way to speed up the upload (image) to a container in CloudKit? 有谁知道是否有办法加快向CloudKit中的容器上传(图像)的速度? If I use Parse for the same function, it is 3 to 4 times faster than uploading to CloudKit.... Same applies for downloading. 如果我将Parse用于相同的功能,则它比上载到CloudKit的速度要快3到4倍。...同样适用于下载。 Any ideas? 有任何想法吗?

Thanks Armin 谢谢阿明

If you are using saveRecord, then it could be that the operation is being given lower priority. 如果使用saveRecord,则可能是因为该操作的优先级较低。 Per Apple's documentation: 根据Apple的文档:

This method saves the record with a low priority, which may cause the task to execute after higher-priority tasks. 此方法以低优先级保存记录,这可能导致任务在高优先级任务之后执行。 To save records more urgently, create a CKModifyRecordsOperation object with the desired priority. 要更紧急地保存记录,请创建具有所需优先级的CKModifyRecordsOperation对象。 You can also use that operation object to save multiple records simultaneously. 您也可以使用该操作对象同时保存多个记录。

So, if you are indeed using saveRecord, try using CKModifyRecordsOperation instead and see if that improves upload times. 因此,如果您确实在使用saveRecord,请尝试改用CKModifyRecordsOperation,看看是否可以缩短上传时间。

That being said, also do try to optimize the image as much as possible before uploading. 话虽如此,在上传之前也请尝试尽可能地优化图像。 And, in the case of changed (updated) CKRecords, it is not necessary to save all fields of a record (thereby re-uploading existing images) - you can pick and choose the fields you would like to save. 并且,在更改(更新)了CKRecords的情况下,不必保存记录的所有字段(从而重新上传现有图像)-您可以选择要保存的字段。

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM