Skip to content

Commit

Permalink
remove examples of time_imports nesting given it was a bug (#46072)
Browse files Browse the repository at this point in the history
(cherry picked from commit 29586ef)
  • Loading branch information
IanButterworth authored and KristofferC committed Jul 20, 2022
1 parent 9fa6b7f commit bcac3c2
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,39 +356,31 @@ 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.
If a package's dependencies have already been imported either globally or by another dependency they will
not appear under that package and the package will accurately report a faster load time than if it were to
be loaded in isolation.
!!! compat "Julia 1.9"
Reporting of any compilation and recompilation time was added in Julia 1.9
!!! note
During the load process a package sequentially imports all of its dependencies, not just its direct dependencies.
```julia-repl
julia> @time_imports using CSV
0.4 ms ┌ IteratorInterfaceExtensions
11.1 ms ┌ TableTraits 84.88% compilation time
145.4 ms ┌ SentinelArrays 66.73% compilation time
42.3 ms ┌ Parsers 19.66% compilation time
4.1 ms ┌ Compat
8.2 ms ┌ OrderedCollections
1.4 ms ┌ Zlib_jll
2.3 ms ┌ TranscodingStreams
6.1 ms ┌ CodecZlib
0.3 ms ┌ DataValueInterfaces
15.2 ms ┌ FilePathsBase 30.06% compilation time
9.3 ms ┌ InlineStrings
1.5 ms ┌ DataAPI
31.4 ms ┌ WeakRefStrings
14.8 ms ┌ Tables
24.2 ms ┌ PooledArrays
2002.4 ms CSV 83.49% compilation time
50.7 ms Parsers 17.52% compilation time
0.2 ms DataValueInterfaces
1.6 ms DataAPI
0.1 ms IteratorInterfaceExtensions
0.1 ms TableTraits
17.5 ms Tables
26.8 ms PooledArrays
193.7 ms SentinelArrays 75.12% compilation time
8.6 ms InlineStrings
20.3 ms WeakRefStrings
2.0 ms TranscodingStreams
1.4 ms Zlib_jll
1.8 ms CodecZlib
0.8 ms Compat
13.1 ms FilePathsBase 28.39% compilation time
1681.2 ms CSV 92.40% compilation time
```
!!! note
During the load process a package sequentially imports where necessary all of its dependencies, not just
its direct dependencies. That is also true for the dependencies themselves so nested importing will likely
occur, but not always. Therefore the nesting shown in this output report is not equivalent to the dependency
tree, but does indicate where import time has accumulated.
!!! compat "Julia 1.8"
This macro requires at least Julia 1.8
"""
:@time_imports

0 comments on commit bcac3c2

Please sign in to comment.