Skip to content

[Timer] Count number of executed instructions on macOS #2270

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

Closed
wants to merge 1 commit into from

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 19, 2020

In an effort to get performance timers for the Swift parser that are as accurate as possible, I found this PR by Graydon (swiftlang/swift#18658) from a couple years ago, adding a performance metric that counts the number of executed instructions on macOS. According to Graydon (and my intuition), this number is a lot less noisy than the time values.

With this PR, I'm trying to taking the measurements a little bit further by recording them with every LLVM Timer. This way, we get the measurement for free in every place that LLVM Timers are used (which happens to include measurements for the Swift parser, my original goal).

The code is mostly copy-based from either Graydon's PR or other places in Timer.h/cpp. I would appreciate a thorough code review, in particular regarding the implications of my changes to CMakeList.txt.

Also: I'm not sure, if swift/main is the correct branch to target, please let me know if I should target a different branch.

In addition to wall time etc. this should allow us to get less noisy
values for time measurements.
@ahoppen
Copy link
Member Author

ahoppen commented Dec 19, 2020

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jan 18, 2021

Rebased to target apple/stable/20210107 in #2350.

@ahoppen ahoppen closed this Jan 18, 2021
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