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

extreme_filter: performance gap between UInt8 and Gray{N0f8} for diamond shape SE #103

Open
johnnychen94 opened this issue Jun 24, 2022 · 0 comments

Comments

@johnnychen94
Copy link
Member

johnnychen94 commented Jun 24, 2022

After #102:

img = float64.(imresize(testimage("cameraman"), (512, 512)));
@btime erode($img, $(strel_diamond(img)));

img_nf08 = n0f8.(imresize(testimage("cameraman"), (256, 256)));
@btime erode($img_nf08, $(strel_diamond(img_nf08)));
type size time (ms)
UInt8 (256, 256) 0.008
UInt8 (512, 512) 0.028
UInt8 (1024, 1024) 0.108
Float64 (256, 256) 0.047
Float64 (512, 512) 0.251
Float64 (1024, 1024) 1.450
type size time (ms)
Gray{N0f8} (256, 256) 0.014
Gray{N0f8} (512, 512) 0.036
Gray{N0f8} (1024, 1024) 0.118
Gray{Float64} (256, 256) 0.049
Gray{Float64} (512, 512) 0.247
Gray{Float64} (1024, 1024) 1.487

This is mainly because rawview(channelview(img_n0f8)) is a MappedArray and should be fixed somewhere upstream (ImageCore, probably)

julia> versioninfo()
Julia Version 1.9.0-DEV.843
Commit 4873773d37e (2022-06-23 18:35 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.5.0)
  CPU: 16 × Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.5 (ORCJIT, skylake)
  Threads: 8 on 8 virtual cores
Environment:
  JULIA_NUM_THREADS = 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant