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

Save ScheduleDiagnostics as Vectors #84

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Save ScheduleDiagnostics as Vectors #84

merged 1 commit into from
Sep 26, 2024

Conversation

Sbozzolo
Copy link
Member

ScheduleDiagnostics with NetCDFWriters have a complex type structure that can lead to significant compile time. We originally saved ScheduleDiagnostics internally as tuples to improve inferrability, but this does not seem to scale well with lots of diagnostics.

In the future, we might want to consider looking at the type signature and move the reference to the writer outside of ScheduleDiagnostics and into the DiagnosticHandler.

Hopefully, closes #83

`ScheduleDiagnostic`s with `NetCDFWriter`s have a complex type structure
that can lead to significant compile time. We originally saved
`ScheduleDiagnostic`s internally as tuples to improve inferrability, but
this does not seem to scale well with lots of diagnostics.

In the future, we might want to consider looking at the type signature
and move the reference to the writer outside of `ScheduleDiagnostic`s
and into the `DiagnosticHandler`.
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.90%. Comparing base (c1cc7c3) to head (ddbfbfa).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #84   +/-   ##
=======================================
  Coverage   84.90%   84.90%           
=======================================
  Files          13       13           
  Lines         510      510           
=======================================
  Hits          433      433           
  Misses         77       77           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@charleskawczynski charleskawczynski left a comment

Choose a reason for hiding this comment

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

I tried this out, and I get 2717.614951 seconds (1.45 G allocations: 86.332 GiB, 90.87% gc time, 99.35% compilation time: <1% of which was recompilation).

I also tried the version without diagnostics a second time, and got 2439.740156 seconds (1.33 G allocations: 78.446 GiB, 92.70% gc time, 99.82% compilation time: <1% of which was recompilation). So, there's clearly variation, and this also seems to improve compile times. Let's give this a try, I think that this is a good patch solution for now.

@Sbozzolo Sbozzolo merged commit 7b08031 into main Sep 26, 2024
12 checks passed
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.

Long compile times
2 participants