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

Show cumulative compile time #27

Closed
wants to merge 6 commits into from
Closed

Show cumulative compile time #27

wants to merge 6 commits into from

Conversation

eaigner
Copy link
Contributor

@eaigner eaigner commented May 23, 2016

This change groups all identical lines together and shows their summed up build time. It also removes the 20 results limit and only logs files whose cumulative compile time exceeds 10ms. Also if a single line in the same source file produces multiple results, but with a different column, they are summed up too.

This unfortunately also disables the live update (for now).

Closes #26

@RobertGummesson
Copy link
Owner

Nice one. Let me try it out later. I can sort out the live updates so don't worry about that.

@eaigner
Copy link
Contributor Author

eaigner commented May 23, 2016

The problem with the live updates is that the results can only be generated after all values are known (since the compile times are accumulated)

@RobertGummesson
Copy link
Owner

RobertGummesson commented May 23, 2016

No problem. I know how to work around that. 🙂

@RobertGummesson
Copy link
Owner

RobertGummesson commented May 23, 2016

Hmmm... I just did a test and the values look a bit odd. For this

let indicatorSize = CGSize(width: 20, height: 20)
lazy private var labelOffset: CGPoint = CGPoint(x: -self.indicatorSize.width * 0.15, y: -20)

I got a build time of 820ms for the labelOffset getter and it's only referenced twice. If I stick the same two lines of code in a new project, the labelOffset is built in nearly 0.0ms.

However odd that may seem, it does seem that compiler actually does spend the time on this:

16.8ms  CMGridView.swift:28:14  @objc get {}
9.3ms   CMGridView.swift:28:14  @objc get {}
11.5ms  CMGridView.swift:28:14  @objc get {}
10.3ms  CMGridView.swift:28:14  @objc get {}
9.8ms   CMGridView.swift:28:14  @objc get {}
8.8ms   CMGridView.swift:28:14  @objc get {}
18.6ms  CMGridView.swift:28:14  @objc get {}
9.0ms   CMGridView.swift:28:14  @objc get {}
12.4ms  CMGridView.swift:28:14  @objc get {}
10.2ms  CMGridView.swift:28:14  @objc get {}
...and so on.

When I have a moment, I'll try to make my fresh project behave this way too and measure the overall build time to verify that this is actual compiler time. ...which it does seem to be.

@RobertGummesson
Copy link
Owner

Could you please direct this pull request to the branch called "cumulative-compile-time" instead of master? Will fix the live update on there. Also noted an issue if all compile times are less than 10ms which I can fix.

@eaigner eaigner closed this May 23, 2016
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.

None yet

2 participants