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

showing Dict types got a lot slower (300x) #37990

Open
KristofferC opened this issue Oct 11, 2020 · 2 comments
Open

showing Dict types got a lot slower (300x) #37990

KristofferC opened this issue Oct 11, 2020 · 2 comments
Labels
display and printing Aesthetics and correctness of printed representations of objects. performance Must go faster regression Regression in behavior compared to a previous version

Comments

@KristofferC
Copy link
Member

KristofferC commented Oct 11, 2020

1.5:

julia> @btime sprint(show, Dict{String, Any})
  1.300 μs (21 allocations: 1.03 KiB)
"Dict{String,Any}"

1.6:

julia> @btime sprint(show, Dict{String, Any})
  348.819 μs (32 allocations: 21.31 KiB)
"Dict{String, Any}"

Trace is

 1╎    ╎    ╎     363 @Base/strings/io.jl:105; sprint(f::Function, args::Type; context::Nothing, sizehint::I...
  ╎    ╎    ╎    ╎ 359 @Base/show.jl:763; show(io::IOBuffer, x::Type)
 2╎    ╎    ╎    ╎  359 @Base/show.jl:637; show_typealias(io::IOBuffer, x::Type)
  ╎    ╎    ╎    ╎   158 @Base/show.jl:551; make_typealias(x::Type)
  ╎    ╎    ╎    ╎    158 @Base/reflection.jl:98; names
68╎    ╎    ╎    ╎     158 @Base/reflection.jl:98; #names#10
  ╎    ╎    ╎    ╎    ╎ 90  @Base/sort.jl:735; sort!
  ╎    ╎    ╎    ╎    ╎  90  @Base/sort.jl:747; #sort!#8
  ╎    ╎    ╎    ╎    ╎   90  @Base/sort.jl:687; sort!
  ╎    ╎    ╎    ╎    ╎    90  @Base/sort.jl:616; sort!
  ╎    ╎    ╎    ╎    ╎     45  @Base/sort.jl:622; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base....
  ╎    ╎    ╎    ╎    ╎    ╎ 21  @Base/sort.jl:622; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎  13  @Base/sort.jl:623; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎ 15  @Base/sort.jl:623; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎  8   @Base/sort.jl:623; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎   6   @Base/sort.jl:622; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Bas...
  ╎    ╎    ╎    ╎    ╎     33  @Base/sort.jl:623; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base....
  ╎    ╎    ╎    ╎    ╎    ╎ 12  @Base/sort.jl:622; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎  7   @Base/sort.jl:622; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎ 19  @Base/sort.jl:623; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎  11  @Base/sort.jl:623; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Base...
  ╎    ╎    ╎    ╎    ╎    ╎   6   @Base/sort.jl:622; sort!(v::Vector{Symbol}, lo::Int64, hi::Int64, a::Bas...
54╎    ╎    ╎    ╎   96  @Base/show.jl:552; make_typealias(x::Type)
27╎    ╎    ╎    ╎    27  @Base/reflection.jl:102; isdeprecated
68╎    ╎    ╎    ╎   77  @Base/show.jl:554; make_typealias(x::Type)

This is related to the fancy typealias printing but is there a way to perhaps limit that to e.g. REPL usage.

Ref #36107
Ref #37989.

@KristofferC KristofferC added regression Regression in behavior compared to a previous version display and printing Aesthetics and correctness of printed representations of objects. labels Oct 11, 2020
@yuyichao
Copy link
Contributor

yuyichao commented Oct 11, 2020

Did you reverse the result or is 1.6 actually faster?

@KristofferC
Copy link
Member Author

I reversed, sorry, updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects. performance Must go faster regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants