1

On an iPad how many parallel operations can start to get maximum performance? in each run a query operation , calculations , etc ...

It depends on the iPad model (CPU)?

      int count = [objects count];
  if (count > 0)
  {
    dispatch_group_t group = dispatch_group_create();
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    for (int i = 0; i < count; i++)
    {
      dispatch_group_async(group, queue, ^{
        for (int j = i + 1; j < count; j++)
        {
          dispatch_group_async(group, queue, ^{
            /** LOTS AND LOTS OF WORK FOR EACH OBJECT **/
          });
        }
      });
    }

        dispatch_group_notify(group, queue, ^{
/** END OF ALL OPERATIONS */
    };


  }
matti157
  • 1,288
  • 2
  • 13
  • 26
  • There is a hard limit of 64 concurrent operations (per top level concurrent queue) you can do in GCD - so you'll want to stay below that. [See my answer here](http://stackoverflow.com/a/34854593/2976878) and [this answer here](http://stackoverflow.com/a/15150800/2976878) for more info. As far as how many concurrent operations you need to be doing in the first place - that's really a UX question, [as daredevil says](http://stackoverflow.com/a/36356884/2976878). – Hamish Apr 01 '16 at 20:31

1 Answers1

1

This is basically a UX question. Depends on the needs of the end user.
Does he really need all those computations started and finished quickly ?
Can you delay some or most of them ?
It's good practice to inform the user with a progress of each computation (a progress bar) and notify him upon completion.
Let him choose which to start / stop / pause (this is a very important feature).

If all the tasks are local - CPU intensive, and not related to network fetching of resources, then it depends on each CPU device - how many threads can it run in parallel.

StefanS
  • 1,089
  • 1
  • 11
  • 38