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

Slow with large images #292

Open
chrstphrbrns opened this issue Oct 2, 2023 · 5 comments
Open

Slow with large images #292

chrstphrbrns opened this issue Oct 2, 2023 · 5 comments

Comments

@chrstphrbrns
Copy link

chrstphrbrns commented Oct 2, 2023

imshow takes more than two minutes to show a 12000x5000 image, and ~40 seconds to show a 5120x2880 image

Here's the data type for the first image (both were loaded using TiffImages

5000×12000 TiffImages.DenseTaggedImage{ColorTypes.RGB{FixedPointNumbers.N0f8}, 2, UInt32, Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}}
julia> versioninfo()
Julia Version 1.11.0-DEV.586
Commit e9d633f70a* (2023-10-01 18:36 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × AMD Ryzen 9 3950X 16-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
  Threads: 47 on 32 virtual cores
Environment:
  LD_PRELOAD = /lib/x86_64-linux-gnu/libc_malloc_debug.so.0
  JULIA_NUM_THREADS = 32
  JULIA_EDITOR = vim
@chrstphrbrns
Copy link
Author

Just discovered that ctrl-c will get the image on screen fast, so whatever it's doing for two minutes is apparently not essential

ulia> imshow(TiffImages.load("image.tif"))
Dict{String, Any} with 4 entries:^CError showing value of type Dict{String, Any}:
ERROR: InterruptException:
Stacktrace:
  [1] writeshortest(buf::Vector{…}, pos::Int64, x::Float64, plus::Bool, space::Bool, hash::Bool, precision::Int64, expchar::UInt8, padexp::Bool, decchar::UInt8, typed::Bool, compact::Bool)
    @ Base.Ryu ./ryu/shortest.jl:227
  [2] show(io::IOContext{IOBuffer}, x::Float64, forceuntyped::Bool, fromprint::Bool)
    @ Base.Ryu ./ryu/Ryu.jl:116
  [3] show(io::IO, x::T, forceuntyped::Bool, fromprint::Bool) where T<:Union{Float16, Float32, Float64}
    @ Base.Ryu ./ryu/Ryu.jl:113 [inlined]
  [4] show(io::IOContext{IOBuffer}, x::FixedPointNumbers.N0f8)
    @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/HAGk2/src/FixedPointNumbers.jl:274
  [5] _show_components(io::IOContext{IOBuffer}, c::ColorTypes.RGB{FixedPointNumbers.N0f8})
    @ ColorTypes ~/.julia/packages/ColorTypes/1dGw6/src/show.jl:21
  [6] show(io::IOContext{IOBuffer}, c::ColorTypes.RGB{FixedPointNumbers.N0f8})
    @ ColorTypes ~/.julia/packages/ColorTypes/1dGw6/src/show.jl:13
  [7] _show_nonempty(io::IOContext{IOBuffer}, X::AbstractMatrix, prefix::String, drop_brackets::Bool, axs::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}})
    @ Base ./arrayshow.jl:445
  [8] _show_nonempty(io::IOContext{IOBuffer}, X::MappedArrays.ReadonlyMappedArray{ColorTypes.RGB{…}, 2, SubArray{…}, ImageView.var"#74#75"{…}}, prefix::String)
    @ Base ./arrayshow.jl:413
  [9] show
    @ ./arrayshow.jl:491 [inlined]

@ashwanirathee
Copy link
Member

ashwanirathee commented Oct 3, 2023

We are aware of the issue @chrstphrbrns or something similar, this comes from GTK and is supposed to be fixed in the new release.

@mkitti
Copy link
Member

mkitti commented Oct 3, 2023

What is the issue, @ashwani-rathee ?

@jwahlstrand
Copy link
Collaborator

This doesn't look like the GTK issue. From the stacktrace it looks like it's taking forever to show() something in the output. Does calling imshow with a semicolon at the end speed it up?

@chrstphrbrns
Copy link
Author

This doesn't look like the GTK issue. From the stacktrace it looks like it's taking forever to show() something in the output. Does calling imshow with a semicolon at the end speed it up?

Yes

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

No branches or pull requests

4 participants