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

Dict display performance #10256

Closed
jakebolewski opened this issue Feb 20, 2015 · 4 comments
Closed

Dict display performance #10256

jakebolewski opened this issue Feb 20, 2015 · 4 comments
Labels
performance Must go faster

Comments

@jakebolewski
Copy link
Member

I have not looked into why this is the case but here is an example:

julia> D = Dict()
Dict{Any,Any} with 0 entries

julia> for key in [randstring() for i=1:5000]
           D[key] = randn(100_000)
       end

julia> @time display(D)
  "kfCodtXI" => [1.6888401174417957,-1.4307288883093494,0.9559295172958958,0.7167676654234264,0.3473601699748082,0.9725759548997545,-0.4779459387535729,-0.9965805074751564,-0.552766042152107,1.5609540447598185,0.409914342350185,0.20369490772349627,
            => 
elapsed time: 1.716493913 seconds (441943508 bytes allocated, 1.54% gc time)

vs

julia> A = randn((5_000, 100_000));
julia> @time display(A);
5000x100000 Array{Float64,2}:
elapsed time: 0.01819924 seconds (3621724 bytes allocated)
@JeffBezanson
Copy link
Member

It might be because it uses sprint(show, v) on every value, which prints all of it to a string, and then truncates afterwards.

@jakebolewski
Copy link
Member Author

Makes sense. This is really bad for large sparse arrays, see #10257.

@mbauman
Copy link
Member

mbauman commented Feb 20, 2015

Dup of #9481, and really depends upon #7959 for a proper fix.

@mbauman mbauman closed this as completed Feb 20, 2015
@JeffBezanson
Copy link
Member

Fixing performance this terrible doesn't depend on any big redesigns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

No branches or pull requests

3 participants