Skip to content

Commit

Permalink
remove show method for TrackedArray
Browse files Browse the repository at this point in the history
This method causes horrible invalidations and causes havoc in loading times and compilation time after Tracker.jl is loaded.

For example, loading Enzyme.jl goes from 0.5 seconds to 22 seconds if Tracker.jl is loaded first.

The printing of types should hopefully have been improved enough in JuliaLang/julia#49795 that this is not needed.
  • Loading branch information
KristofferC authored Nov 17, 2023
1 parent 8c93470 commit 08739ec
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ Base.convert(T::Type{<:TrackedArray}, x::TrackedArray) =
Base.convert(::Type{<:TrackedArray{T,N,A}}, x::AbstractArray) where {T,N,A} =
TrackedArray(convert(A, x))

Base.show(io::IO, t::Type{TrackedArray{T,N,A}}) where {T,N,A<:AbstractArray{T,N}} =
@isdefined(A) ?
print(io, "TrackedArray{…,$A}") :
invoke(show, Tuple{IO,DataType}, io, t)

function Base.summary(io::IO, x::TrackedArray)
print(io, "Tracked ")
summary(io, data(x))
Expand Down

0 comments on commit 08739ec

Please sign in to comment.