Skip to content

Commit 29586ef

Browse files
remove examples of time_imports nesting given it was a bug (#46072)
1 parent 425d5e0 commit 29586ef

File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

HISTORY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Standard library changes
115115

116116
#### InteractiveUtils
117117

118-
* New macro `@time_imports` for reporting any time spent importing packages and their dependencies ([#41612]).
118+
* New macro `@time_imports` for reporting any time spent importing packages and their dependencies, highlighting
119+
compilation and recompilation time as percentages per import ([#41612],[#45064]).
119120

120121
#### LinearAlgebra
121122

NEWS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Library changes
8484
* `RoundFromZero` now works for non-`BigFloat` types ([#41246]).
8585
* `Dict` can be now shrunk manually by `sizehint!` ([#45004]).
8686
* `@time` now separates out % time spent recompiling invalidated methods ([#45015]).
87-
* `@time_imports` now shows any compilation and recompilation time percentages per import ([#45064]).
8887
* `eachslice` now works over multiple dimensions; `eachslice`, `eachrow` and `eachcol` return
8988
a `Slices` object, which allows dispatching to provide more efficient methods ([#32310]).
9089

stdlib/InteractiveUtils/src/macros.jl

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -356,39 +356,31 @@ See also: [`code_native`](@ref), [`@code_llvm`](@ref), [`@code_typed`](@ref) and
356356
A macro to execute an expression and produce a report of any time spent importing packages and their
357357
dependencies. Any compilation time will be reported as a percentage, and how much of which was recompilation, if any.
358358
359-
If a package's dependencies have already been imported either globally or by another dependency they will
360-
not appear under that package and the package will accurately report a faster load time than if it were to
361-
be loaded in isolation.
362-
363-
!!! compat "Julia 1.9"
364-
Reporting of any compilation and recompilation time was added in Julia 1.9
359+
!!! note
360+
During the load process a package sequentially imports all of its dependencies, not just its direct dependencies.
365361
366362
```julia-repl
367363
julia> @time_imports using CSV
368-
0.4 ms ┌ IteratorInterfaceExtensions
369-
11.1 ms ┌ TableTraits 84.88% compilation time
370-
145.4 ms ┌ SentinelArrays 66.73% compilation time
371-
42.3 ms ┌ Parsers 19.66% compilation time
372-
4.1 ms ┌ Compat
373-
8.2 ms ┌ OrderedCollections
374-
1.4 ms ┌ Zlib_jll
375-
2.3 ms ┌ TranscodingStreams
376-
6.1 ms ┌ CodecZlib
377-
0.3 ms ┌ DataValueInterfaces
378-
15.2 ms ┌ FilePathsBase 30.06% compilation time
379-
9.3 ms ┌ InlineStrings
380-
1.5 ms ┌ DataAPI
381-
31.4 ms ┌ WeakRefStrings
382-
14.8 ms ┌ Tables
383-
24.2 ms ┌ PooledArrays
384-
2002.4 ms CSV 83.49% compilation time
364+
50.7 ms Parsers 17.52% compilation time
365+
0.2 ms DataValueInterfaces
366+
1.6 ms DataAPI
367+
0.1 ms IteratorInterfaceExtensions
368+
0.1 ms TableTraits
369+
17.5 ms Tables
370+
26.8 ms PooledArrays
371+
193.7 ms SentinelArrays 75.12% compilation time
372+
8.6 ms InlineStrings
373+
20.3 ms WeakRefStrings
374+
2.0 ms TranscodingStreams
375+
1.4 ms Zlib_jll
376+
1.8 ms CodecZlib
377+
0.8 ms Compat
378+
13.1 ms FilePathsBase 28.39% compilation time
379+
1681.2 ms CSV 92.40% compilation time
385380
```
386381
387-
!!! note
388-
During the load process a package sequentially imports where necessary all of its dependencies, not just
389-
its direct dependencies. That is also true for the dependencies themselves so nested importing will likely
390-
occur, but not always. Therefore the nesting shown in this output report is not equivalent to the dependency
391-
tree, but does indicate where import time has accumulated.
382+
!!! compat "Julia 1.8"
383+
This macro requires at least Julia 1.8
392384
393385
"""
394386
:@time_imports

0 commit comments

Comments
 (0)