Skip to content

Commit

Permalink
Format extensions with parent in @time_imports report (#47945)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6d4132b)
  • Loading branch information
IanButterworth authored and KristofferC committed Dec 28, 2022
1 parent ba741a4 commit 9fa0fcf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,12 @@ function _include_from_serialized(pkg::PkgId, path::String, ocachepath::Union{No
elapsed = round((time_ns() - t_before) / 1e6, digits = 1)
comp_time, recomp_time = cumulative_compile_time_ns() .- t_comp_before
print(lpad(elapsed, 9), " ms ")
for extid in EXT_DORMITORY
if extid.id == pkg
print(extid.parentid.name, "")
break
end
end
print(pkg.name)
if comp_time > 0
printstyled(" ", Ryu.writefixed(Float64(100 * comp_time / (elapsed * 1e6)), 2), "% compilation time", color = Base.info_color())
Expand Down
5 changes: 3 additions & 2 deletions doc/src/manual/code-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,10 @@ The subscripted `rootsᵢ`, `graphᵢ` and `pathsᵢ` variables correspond to th
2. Packages in non-primary environments can end up using incompatible versions of their dependencies even if their own environments are entirely compatible. This can happen when one of their dependencies is shadowed by a version in an earlier environment in the stack (either by graph or path, or both).

Since the primary environment is typically the environment of a project you're working on, while environments later in the stack contain additional tools, this is the right trade-off: it's better to break your development tools but keep the project working. When such incompatibilities occur, you'll typically want to upgrade your dev tools to versions that are compatible with the main project.
### "Extension"s

An "extension" is a module that is automatically loaded when a specified set of other packages (its "extension dependencies") are loaded in the current Julia session. The extension dependencies of an extension are a subset of those packages listed under the `[weakdeps]` section of a Project file. Extensions are defined under the `[extensions]` section in the project file:
### [Package Extensions](@id man-extensions)

A package "extension" is a module that is automatically loaded when a specified set of other packages (its "extension dependencies") are loaded in the current Julia session. The extension dependencies of an extension are a subset of those packages listed under the `[weakdeps]` section of a Project file. Extensions are defined under the `[extensions]` section in the project file:

```toml
name = "MyPackage"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ See also: [`code_native`](@ref), [`@code_llvm`](@ref), [`@code_typed`](@ref) and
A macro to execute an expression and produce a report of any time spent importing packages and their
dependencies. Any compilation time will be reported as a percentage, and how much of which was recompilation, if any.
On Julia 1.9+ [package extensions](@ref man-extensions) will show as Parent → Extension.
!!! note
During the load process a package sequentially imports all of its dependencies, not just its direct dependencies.
Expand Down

0 comments on commit 9fa0fcf

Please sign in to comment.