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

为什么dispatch_async放在for循环效率会变那么高 #5

Open
PhilCai1993 opened this issue Apr 25, 2016 · 3 comments
Open

为什么dispatch_async放在for循环效率会变那么高 #5

PhilCai1993 opened this issue Apr 25, 2016 · 3 comments

Comments

@PhilCai1993
Copy link

No description provided.

@jasonhotsauce
Copy link

因为for循环中所需要执行的任务都dispatch到后台执行了,所以每次循环都是立刻返回。
这里还可以用dispatch_apply来代替,更加明了一些。@ChenYilong

@PhilCai1993
Copy link
Author

@jasonhotsaucedispatch_async这个操作不会很耗时咯?

@jasonhotsauce
Copy link

jasonhotsauce commented Jun 22, 2016

做 dispatch_async这个操作不会很耗时咯?

这个要相对的来看,一般来说是不太影响performance的,但是如果滥用的话,也会有问题。

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

No branches or pull requests

2 participants