FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

for in 循环阻塞主线程启动 by leavesster · Pull Request #14 · ChenYilong/ParseSourceCodeStudy · GitHub

for in 循环阻塞主线程启动 - #14

Closed
leavesster wants to merge 1 commit into
ChenYilong:masterfrom
leavesster:master
Closed

for in 循环阻塞主线程启动#14
leavesster wants to merge 1 commit into
ChenYilong:masterfrom
leavesster:master

Conversation

Copy link
Copy Markdown

demo7 中,使用了实战优化,但是实际仍然卡在了App启动界面。

个人理解:
for in 开销过多,而紧随着的block很快,导致误以为优化失败。其实优化成功,但是此处block太快,for in循环反而太多,导致效果不明显。
这里减少了for in 次数,延长block 执行时间,就可以明显观察到未被阻塞。但是如果要优化,还是需要加开for in 的情况下,才会效果明显吧。

leavesster closed this Jul 15, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL