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

Add a docs section about loading/precomp/ttfx time tuning #55569

Merged
merged 5 commits into from
Sep 14, 2024

Conversation

IanButterworth
Copy link
Sponsor Member

@IanButterworth IanButterworth commented Aug 22, 2024

It seems like it would be helpful to highlight some of these tools/best practices.

Please feel free to expand. I propose we get something in before 1.11 is released and grow the docs though, given there isn't much official guidance currently

@IanButterworth IanButterworth added domain:docs This change adds or pertains to documentation domain:packages Package management and loading labels Aug 22, 2024
@IanButterworth IanButterworth marked this pull request as ready for review September 7, 2024 19:08
@ChrisRackauckas
Copy link
Member

A few things:

  1. I think there should be some mention of package extensions, since one of the easiest ways to reduce long package loads is to simply remove an offending package from the dependencies.
  2. I think pointing to and showing a compile time flame graph and how to use ProfileView to get it would be helpful, since that's the easiest way to view the compile times.
  3. You should introduce and define the term TTFX so that it can have a canonical definition and explanation in the docs.

doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
Copy link
Sponsor Member

@timholy timholy left a comment

Choose a reason for hiding this comment

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

I think the idea here is a good one. A few comments to consider below:

doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Outdated Show resolved Hide resolved
doc/src/manual/performance-tips.md Show resolved Hide resolved
@IanButterworth
Copy link
Sponsor Member Author

Thanks for the reviews! I've absorbed most suggestions, but not the flamegraph yet. Is there a good example of that I can use off the shelf?

IanButterworth and others added 4 commits September 13, 2024 13:02
Co-authored-by: Christian Guinard <28689358+christiangnrd@users.noreply.github.com>
Co-authored-by: Tim Holy <tim.holy@gmail.com>
@IanButterworth IanButterworth added the backport 1.11 Change should be backported to release-1.11 label Sep 13, 2024
@IanButterworth
Copy link
Sponsor Member Author

Invalidations aren't currently mentioned in the docs so there's no where to link to. I think that's a separate PR.

For the backport to 1.11 --trace-compile-timing will need to be removed.

@timholy
Copy link
Sponsor Member

timholy commented Sep 13, 2024

You could conceivably link to the blog or SnoopCompile docs. Since you use the term invalidations yet it's not defined in the manual, it seems we should do something to help people understand what this is talking about.

@IanButterworth IanButterworth merged commit 243bded into JuliaLang:master Sep 14, 2024
7 checks passed
@KristofferC KristofferC mentioned this pull request Sep 24, 2024
30 tasks

If package precompilation is taking a long time, one option is to set the following internal and then precompile.
```
julia> Base.PRECOMPILE_TRACE_COMPILE[] = "stderr"
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

FWIW, this is not really a public thing

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Ok. Is there something else we can suggest people use here?

KristofferC added a commit that referenced this pull request Sep 25, 2024
Backported PRs:
- [x] #55773 <!-- Add compat entry for `Base.donotdelete` -->
- [x] #41244 <!-- Fix shell `cd` error when working dir has been deleted
-->
- [x] #55795 <!-- fix #52986, regression in `@doc` of macro without REPL
loaded -->
- [x] #55829 <!-- [Dates] Make test more robust against non-UTC
timezones -->
- [x] #55641 <!-- fall back to slower stat filesize if optimized
filesize fails -->
- [x] #55744 <!-- fix #45494, error in ssa conversion with complex type
decl -->
- [x] #55783 <!-- use `inferencebarrier` instead of `invokelatest` for
1-arg `@assert` -->
- [x] #55739 <!-- Add `invokelatest` barrier to `string(...)` in
`@assert` -->

Need manual backport:
- [ ] #55798 <!-- Broadcast binary ops involving strided triangular -->

Contains multiple commits, manual intervention needed:
- [ ] #55509 <!-- Fix cong implementation to be properly random and not
just cycling. -->
- [ ] #55569 <!-- Add a docs section about loading/precomp/ttfx time
tuning -->
- [ ] #55824 <!-- Replace regex package module checks with actual code
checks -->

Non-merged PRs with backport label:
- [ ] #55845 <!-- privatize annotated string API, take two -->
- [ ] #55828 <!-- Fix some corner cases of `isapprox` with unsigned
integers -->
- [ ] #55813 <!-- Check for conflicting `@ccallable` name before JIT
registration -->
- [ ] #55743 <!-- doc: heap snapshot viewing -->
- [ ] #55741 <!-- Change annotations to use a NamedTuple -->
- [ ] #55534 <!-- Set stdlib sources as read-only during installation
-->
- [ ] #55499 <!-- propagate the terminal's `displaysize` to the
`IOContext` used by the REPL -->
- [ ] #55458 <!-- Allow for generically extracting unannotated string
-->
- [ ] #55457 <!-- Make AnnotateChar equality consider annotations -->
- [ ] #55453 <!-- Privatise the annotations API, for StyledStrings -->
- [ ] #55355 <!-- relocation: account for trailing path separator in
depot paths -->
- [ ] #55220 <!-- `isfile_casesensitive` fixes on Windows -->
- [ ] #55169 <!-- `propertynames` for SVD respects private argument -->
- [ ] #54457 <!-- Make `String(::Memory)` copy -->
- [ ] #53957 <!-- tweak how filtering is done for what packages should
be precompiled -->
- [ ] #51479 <!-- prevent code loading from lookin in the versioned
environment when building Julia -->
- [ ] #50813 <!-- More doctests for Sockets and capitalization fix -->
- [ ] #50157 <!-- improve docs for `@inbounds` and
`Base.@propagate_inbounds` -->
@KristofferC KristofferC mentioned this pull request Sep 30, 2024
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 domain:docs This change adds or pertains to documentation domain:packages Package management and loading profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants