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

Optimize scheduler size and performance #1309

Merged
merged 2 commits into from
Aug 30, 2019

Conversation

balloonzzq
Copy link
Collaborator

  • Performance: Use while instead of foreach for a small performance boost. jsperf
  • Packet size: Reduce 0.0058 KB

if (updateCallbacks.length === 0) {
scheduler(flush);
}
updateCallbacks.length === 0 && scheduler(flush);
Copy link
Collaborator

@yuanyan yuanyan Aug 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

压缩的时候我记得会自动优化都这个格式,可以确认下,如果工具会自动处理可以保留这里的可读性。

Copy link
Collaborator Author

@balloonzzq balloonzzq Aug 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

压缩会把 if 后的两个大括号去除,该格式可以少两个字符。考虑可读性,可以保留格式。

@yuanyan yuanyan merged commit 45fdcdb into alibaba:master Aug 30, 2019
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.

2 participants