Perfomance Restkit with AFNetworking

0

I have created a reserver using the Slim Framework (PHP), connecting to a MySQL DB. You are on a dedicated server with moderate performance, ie the response is very fast.

But I did a test app in IOS where I consult this api and mount a table view with the result. In wifi it goes fast, however in the "3g" it takes 15 to 30 seconds to load!

I'm using Restkit with AFNetworking. The api link is: link (can access to see the result / speed) Is it normal to take all this time to mount the UITableView on a small json of these?

Does anyone know how to solve this?

    
asked by anonymous 18.08.2014 / 19:42

1 answer

1

Everything indicates that it is a network problem but even for a 3G connection, it is a long time to get data.

I made a very simple benchmark, the minimum time for your answering service was 511ms and the biggest 2.11secs, that is, everything is within the normal range.

Maybe it's a problem with your data network, which has nothing to do with AFNetworking or ResKit.

UPDATE The hypostation raised on the table is being updated outside the main thread makes sense.

First of all, to be sure, place a breakpoint at the point where your table updates and run in debug mode, when the application stops at the breakpoint, make sure the stack is inside the main thread, see the example below how appear.

If it is not stopped in the main thread, use the solution below to execute the call that causes your table to update.

dispatch_async(dispatch_get_main_queue(), ^{
  // execute aqui a chamada que faz sua tabela atualizar
});
    
18.08.2014 / 20:34