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

Avoid confounding compilation side effects of @time_imports #55729

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

IanButterworth
Copy link
Sponsor Member

@IanButterworth IanButterworth commented Sep 10, 2024

Makes functions for the report printing that can be precompiled into the sysimage.

@IanButterworth
Copy link
Sponsor Member Author

@KristofferC I figured breaking the printing out into functions that can be precompiled into the sysimage makes more sense

@IanButterworth IanButterworth changed the title add precompiles for @time_imports (and @time) Avoid confounding compilation side effects of @time_imports Sep 10, 2024
@IanButterworth IanButterworth added backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 labels Sep 10, 2024
@IanButterworth
Copy link
Sponsor Member Author

Also tidies up the interleaved printing with --trace-compile so that it's blocks of precompile between each report line making it easier to understand what caused them.

% ./julia --start=no --trace-compile=stderr --trace-compile-timing -e "using InteractiveUtils; @time @time_imports using MicroMamba"
      0.5 ms  Printf
     15.0 ms  Dates
      0.3 ms  Scratch
     10.0 ms  LazyArtifacts
      1.0 ms  TOML
      7.2 ms  Preferences
      0.5 ms  JLLWrappers
#=    0.0 ms =# precompile(Tuple{typeof(micromamba_jll.__init__)})
#=    0.0 ms =# precompile(Tuple{typeof(micromamba_jll.find_artifact_dir)})
#=    2.4 ms =# precompile(Tuple{Type{Base.Val{x} where x}, Module})
#=    2.0 ms =# precompile(Tuple{Type{NamedTuple{(:honor_overrides,), T} where T<:Tuple}, Tuple{Bool}})
#=  439.9 ms =# precompile(Tuple{typeof(Artifacts._artifact_str), Module, String, Base.SubString{String}, String, Base.Dict{String, Any}, Base.SHA1, Base.BinaryPlatforms.Platform, Base.Val{LazyArtifacts}})
#=   24.4 ms =# precompile(Tuple{typeof(Base.unique!), Array{String, 1}})
#=    1.3 ms =# precompile(Tuple{typeof(Base.invokelatest), Any})
#=    0.0 ms =# precompile(Tuple{typeof(JLLWrappers.get_julia_libpaths)})
#=    7.8 ms =# precompile(Tuple{typeof(Base.vcat), Array{String, 1}, Array{String, 1}})
               ┌ 545.2 ms micromamba_jll.__init__() 99.93% compilation time (88% recompilation)
    545.7 ms  micromamba_jll 99.84% compilation time (88% recompilation)
      0.4 ms  MicroMamba
#=    2.0 ms =# precompile(Tuple{Type{NamedTuple{(:value, :time, :bytes, :gctime, :gcstats, :lock_conflicts, :compile_time, :recompile_time), T} where T<:Tuple}, Tuple{Nothing, Float64, Int64, Float64, Base.GC_Diff, Int64, Float64, Float64}})
#=    2.9 ms =# precompile(Tuple{typeof(Base.getproperty), NamedTuple{(:value, :time, :bytes, :gctime, :gcstats, :lock_conflicts, :compile_time, :recompile_time), Tuple{Nothing, Float64, Int64, Float64, Base.GC_Diff, Int64, Float64, Float64}}, Symbol})
#=   26.4 ms =# precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:msg,), Tuple{Nothing}}, typeof(Base.time_print), Base.TTY, Float64, Int64, Int64, Int64, Int64, Float64, Float64, Bool})
  0.586889 seconds (763.19 k allocations: 40.931 MiB, 5.56% gc time, 92.84% compilation time: 88% of which was recompilation)
#=   13.0 ms =# precompile(Tuple{Base.var"#start_profile_listener##2#start_profile_listener##3"{Task, Base.AsyncCondition}})

@KristofferC KristofferC mentioned this pull request Sep 11, 2024
33 tasks
@IanButterworth IanButterworth merged commit 255162c into JuliaLang:master Sep 11, 2024
5 of 7 checks passed
@IanButterworth IanButterworth deleted the ib/bake_more_time_in branch September 11, 2024 15:50
@KristofferC KristofferC mentioned this pull request Sep 12, 2024
45 tasks
KristofferC pushed a commit that referenced this pull request Sep 12, 2024
…#55729)

Makes functions for the report printing that can be precompiled into the
sysimage.

(cherry picked from commit 255162c)
kshyatt pushed a commit that referenced this pull request Sep 12, 2024
…#55729)

Makes functions for the report printing that can be precompiled into the
sysimage.
KristofferC added a commit that referenced this pull request Sep 17, 2024
Backported PRs:
- [x] #55480 <!-- Fix push! for OffsetVectors, add tests for push! and
append! on AbstractVector -->
- [x] #55443 <!-- Add test for upper/lower/titlecase and fix call -->
- [x] #55524 <!-- Set `.jl` sources as read-only during installation -->
- [x] #55500 <!-- make jl_thread_suspend_and_get_state safe -->
- [x] #55506 <!-- Fix indexing in _mapreducedim for OffsetArrays -->
- [x] #55564 <!-- Empty out loaded_precompiles dict instead of asserting
it's empty. -->
- [x] #55567 <!-- Initialize threadpools correctly during sysimg build
-->
- [x] #55596 <!-- Fast bounds-check for CartesianIndex ranges -->
- [x] #55605 <!-- Reroute Symmetric/Hermitian + Diagonal through
triangular -->
- [x] #55640 <!-- win: move stack_overflow_warning to the backtrace
fiber -->
- [x] #55715 <!-- Add precompile signatures to Markdown to reduce
latency. -->
- [x] #55593 <!-- Fix invalidations for FileIO -->
- [x] #55555 <!-- Revert "Don't expose guard pages to malloc_stack API
consumers" -->
- [x] #55720 <!-- Fix `pkgdir` for extensions -->
- [x] #55729 <!-- Avoid confounding compilation side effects of
`@time_imports` -->
- [x] #55718 <!-- Fix `@time_imports` extension recognition -->
- [x] #55522 <!-- Fix tr for Symmetric/Hermitian block matrices -->

Contains multiple commits, manual intervention needed:
- [ ] #55509 <!-- Fix cong implementation to be properly random and not
just cycling. -->

Non-merged PRs with backport label:
- [ ] #55641 <!-- fall back to slower stat filesize if optimized
filesize fails -->
- [ ] #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` -->
- [ ] #41244 <!-- Fix shell `cd` error when working dir has been deleted
-->
@KristofferC KristofferC removed the backport 1.11 Change should be backported to release-1.11 label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.10 Change should be backported to the 1.10 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants