Calling Parse cloud functions very slow on iOS in

2019-08-08 18:13发布

问题:

We are experiencing an issue, that calling parse functions that return some data is very slow on iOS compared to Android. Especially with iOS 8 (8.0.2 and 8.1) and in 3G/LTE network. Sometimes it takes up to 10 seconds until the response is received, while on Android calling the same function always takes < 1 second. It seems that on some older iOS devices it's faster than on the new iPhone 6. We also tested side by side in the same WiFi network with an iPhone 6 and an iPod Touch, and on the iPod Touch it's about 3 times faster.

It's a Swift project for iOS 7 and 8. We are not in production mode yet on Parse, but again, on other platforms the cloud functions return very fast. The data that is being returned is usually very small, just a "few lines" of JSON.

The issue is not reproducible on the simulator. There the same cloud functions return very fast. Also on some older devices hat are connected via a 3G hotspot it's not reproducible.

Code example:

PFCloud.callFunctionInBackground("getSomethingFromParse", withParameters: ["someId" : someId]) { ( response : AnyObject!,  error : NSError!) -> Void in
        if error == nil {
            println(response)

What could be causing this? To us it seems like an issue in the Parse iOS SDK.

UPDATE:

We could track down the issue. It appears when 4G is activated in the mobile network settings of the iPhone. All of our test devices were in a 3G network. But it doesn't seem to affect the performance of other apps.