JuliaImages / DitherPunk.jl

Dithering algorithms in Julia.
MIT License
68 stars 3 forks source link

Add package benchmarks #41

Closed adrhill closed 3 years ago

adrhill commented 3 years ago

WIP to close #35.

codecov[bot] commented 3 years ago

Codecov Report

Merging #41 (dc5042f) into master (85a124d) will increase coverage by 0.45%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
+ Coverage   88.07%   88.53%   +0.45%     
==========================================
  Files          10       10              
  Lines         151      157       +6     
==========================================
+ Hits          133      139       +6     
  Misses         18       18              
Impacted Files Coverage Δ
src/separate_space.jl 100.00% <0.00%> (ø)
src/error_diffusion.jl 100.00% <0.00%> (ø)
src/ordered.jl 96.55% <0.00%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 85a124d...dc5042f. Read the comment docs.

adrhill commented 3 years ago

Running the BenchmarkTools suite locally, I somehow get the following error:

julia> results = run(SUITE, verbose = true)
(1/4) benchmarking "ordered dithering"...
  (1/4) benchmarking "binary new"...
  done (took 2.037214483 seconds)
  (2/4) benchmarking "binary inplace"...
  done (took 1.306942385 seconds)
  (3/4) benchmarking "per-channel new"...
  done (took 5.92803912 seconds)
  (4/4) benchmarking "per-channel inplace"...
  done (took 5.427815415 seconds)
done (took 15.157240407 seconds)
(2/4) benchmarking "closest color"...
  (1/6) benchmarking "color new"...
  done (took 5.773249534 seconds)
  (2/6) benchmarking "binary new"...
ERROR: MethodError: no method matching -(::Gray{N0f8}, ::Gray{N0f8})
Math on colors is deliberately undefined in ColorTypes, but see the ColorVectorSpace package.
Stacktrace:
  [1] _colordiff(a::Gray{N0f8}, b::Gray{N0f8}, m::DitherPunk.BinaryDitherMetric)
    @ DitherPunk ~/.julia/packages/DitherPunk/nrpLI/src/colorspaces.jl:33

Which is a bit weird, since tests cover this and pass.

And using BenchmarkCI, I get

$ julia benchmark/run_benchmarks.jl
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: LoadError: failed process: Process(`git fetch origin +refs/heads/master:refs/remotes/origin/master`, ProcessExited(128)) [128]

Any idea how to fix these @johnnychen94 ? I've basically copied the setup from ImageContrastAdjustment.jl.

johnnychen94 commented 3 years ago

I think the benchmark CI is set up correctly here; it fails because the master branch current doesn't have benchmark/ folder yet. This PR should be good to merge unless you want to add more benchmark cases.

ERROR: MethodError: no method matching -(::Gray{N0f8}, ::Gray{N0f8}) Math on colors is deliberately undefined in ColorTypes, but see the ColorVectorSpace package.

I've observed similar issues before but can't track it down the cause, this is basically because you're hitting an incompatible Colors and ColorVectorSpace versions. If you active a cleaner project environment with minimal packages installed, the script should work fine.

$ julia benchmark/run_benchmarks.jl git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Unsure of this... It looks like you're using the ssh git protocol, do you have ssh-key correctly set up? Or maybe change the upstream remote with https protocol, for instance,

git remote remote origin
git remote add origin https://github.com/JuliaImages/DitherPunk.jl.git