Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance group cancel. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Performance group cancel. #23

wants to merge 1 commit into from

Conversation

kinarobin
Copy link

  1. Once you want cancel group, the _groupToOperationReferences contains all object,
for (id <PINOperationReference>operationReference in [_groupToOperationReferences objectEnumerator]) 
{
     if ([_operationQueue cancelOperation:operationReference]) {
            dispatch_group_leave(_group);
     }  
}

Execute all object's cancelOperation is so expensive, So I remove single operationReference when
single operation had finished.

  1. If the group start, it's not necessary to nil out the containers.
  _operations = nil;
  _operationPriorities = nil;
  _operationReferences = nil;

Just remove all objects. Thus support adding operations after completion or cancelation.

@ghost
Copy link

ghost commented Jun 24, 2019

1 Warning
⚠️ Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.

Generated by 🚫 Danger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant