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 Tuning #658

Merged
merged 5 commits into from
Sep 22, 2019
Merged

Conversation

kateinoigakukun
Copy link
Collaborator

@kateinoigakukun kateinoigakukun commented Sep 16, 2019

before after
スクリーンショット 2019-09-16 15 39 22 スクリーンショット 2019-09-21 20 05 55

This change make getGroup 4.6 times faster than now in my project.

@bclymer
Copy link
Collaborator

bclymer commented Sep 16, 2019

Based on the surrounding code it doesn't seem like full equality needs to be checked, so this feels like a pretty free win. I'd like @yonaskolb to validate that assumption though.

@kateinoigakukun could you add a code comment explaining why we aren't using contains(element), and then also add a reference to this in the CHANGELOG.md?

@bclymer
Copy link
Collaborator

bclymer commented Sep 16, 2019

Also @kateinoigakukun just because I'm curious, I'd love if you could provide some before and after benchmarks.

@kateinoigakukun kateinoigakukun marked this pull request as ready for review September 21, 2019 11:17
@kateinoigakukun
Copy link
Collaborator Author

Hmmm, why CI triggered for push? It seems jobs for push are not triggered for other PRs.

@yonaskolb
Copy link
Owner

Yeah not sure. I re-ran it earlier to see if it would work. Might be a GitHub actions bug. We can merge without it. Later today I hope to review some of these PRs 👍

if !cachedGroup.children.contains(child) {
cachedGroup.children.append(child)
// Check equality by path because XcodeProj.PBXObject.== is very slow.
if !cachedGroupChildren.contains(where: { $0.path == child.path }) {
Copy link
Owner

Choose a reason for hiding this comment

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

This should be safe to do. Perhaps we can check for sourceTree as well just in case the group has a different root.

@yonaskolb yonaskolb merged commit e981c72 into yonaskolb:master Sep 22, 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.

3 participants