Skip to content
/ roc Public
  • Sponsor
  • Notifications You must be signed in to change notification settings
  • Fork 329
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

Add support for using Tracy with Roc #7706

Merged
merged 24 commits into from
Mar 18, 2025
Merged

Add support for using Tracy with Roc #7706

merged 24 commits into from
Mar 18, 2025

Conversation

bhansconnect
Copy link
Member

Tracy is an awesome profiling tool that helps dive into performance and memory use.
They have an interactive demo at https://tracy.nereid.pl/.

Over the past week, some experiments I have done driven by tracy have lead to reducing the execution time of formatting 100 files of 1000 lines (all the grab bag syntax) by ~40%. Some work was merged with #7704, but more optimization are to follow.

I think that tracy will be a vital tool for creating a version of roc with peak performance. The implementation here is taken from the zig compiler (they also use tracy) and updated for zig version 0.14.0. I have only added a couple of tracing points related to parsing and formatting. I'm sure we will add more stages in the future. As long as tracy is not enable, all of this code is completely cleaned up and becomes a noop.

I tried to also write a general guide on profiling. It is very light, but mentions some tools I have used a lot.

Lastly, this PR updates our build script to:

  1. support tracy
  2. have less duplication
  3. enable building just a single executable without building everything else
  4. Default to system afl cause zig compiled afl is currently broken.

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht
@bhansconnect
Copy link
Member Author

bhansconnect commented Mar 18, 2025

Tracy also helped me find a perf issue with how zig loads files: ziglang/zig#23274

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht
Copy link
Collaborator

@lukewilliamboswell lukewilliamboswell left a comment

Choose a reason for hiding this comment

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

Amazing, thank you for sharing this. It will be a very helpful guide to profiling the compiler.

@bhansconnect
Copy link
Member Author

Hmm, I don't know why this check just started failing now. I think it is also failing on main, but roc bootstrap has the static version of these deps. Not sure what is going on that is leading to bringing in the homebrew version.

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht
…strap

Verified

This commit was signed with the committer’s verified signature.
bhansconnect Brendan Hansknecht
@bhansconnect
Copy link
Member Author

Ok, now I think we are all green with the typo fixed.

@bhansconnect bhansconnect merged commit b9de635 into main Mar 18, 2025
18 checks passed
@bhansconnect bhansconnect deleted the tracy branch March 18, 2025 03:04
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