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

Perf: Emit trace events from load_build_directory_exn #10891

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jchavarri
Copy link
Collaborator

@jchavarri jchavarri commented Sep 6, 2024

This is an attempt to get more granular information on traces about the rule loading process. It adds events for all the steps performed in load_build_directory_exn.

Regular profiles look contain more information:

image

I must be doing something wrong though, because when one looks at the results using Firefox Profile (which doesn't collapse events), the durations of similar events happening in separate build folders always take the same time. Maybe it is related to memoization?

This is visible in the animation below, here is the trace file used for it:

dune_trace_load_rules.json

firefox-profile

@jchavarri
Copy link
Collaborator Author

Easier reviewing with whitespace enabled.

@rgrinberg
Copy link
Member

Try moving this instrumentation to dune_rules/gen_rules for now. This will give you a more accurate idea on how much work is to done to actually generate the rules.

The way you're doing it now is recording a lot of overhead from the engine itself. While that's useful, you will need to separate it from the rule callback later anyway, and some of the events you've added aren't going to make sense once we've upstreamed some of our changes.

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