JuliaImages / DitherPunk.jl

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

Type stability fixes and tests #66

Closed adrhill closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #66 (fc4fea3) into master (9fd57fd) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #66   +/-   ##
=======================================
  Coverage   98.43%   98.44%           
=======================================
  Files          14       14           
  Lines         256      257    +1     
=======================================
+ Hits          252      253    +1     
  Misses          4        4           
Impacted Files Coverage Δ
src/api/color.jl 90.00% <100.00%> (+0.52%) :arrow_up:
src/closest_color.jl 100.00% <100.00%> (ø)
src/clustering.jl 100.00% <100.00%> (ø)
src/colorschemes.jl 100.00% <100.00%> (ø)
src/compat.jl 66.66% <100.00%> (+16.66%) :arrow_up:
src/ordered.jl 98.33% <100.00%> (+0.02%) :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 9fd57fd...fc4fea3. Read the comment docs.

adrhill commented 2 years ago

Any idea how to fix this @johnnychen94?

adrhill commented 2 years ago

IndirectArrays fail on Julia 1.0 with

LoadError: return type IndirectArray{RGB{Normed{UInt8,8}},2,Int64,Array{Int64,2},Array{RGB{Normed{UInt8,8}},1}} does not match inferred return type IndirectArray{RGB{Normed{UInt8,8}},_1,_2,_3,Array{RGB{Normed{UInt8,8}},1}} where _3 where _2 where _1

Dropping @inferred on custom color palette tests.

johnnychen94 commented 2 years ago

Sorry I missed the notification.

IndirectArrays fail on Julia 1.0 with ...

Julia has improved the type inference mechanism over time so you might observe a lot of cases like this one. I wouldn't be surprised at all. If the performance doesn't drop dramatically, I'd say "using the latest stable Julia" is already a good solution (to minimize our maintenance efforts).

adrhill commented 2 years ago

I'd say "using the latest stable Julia" is already a good solution

I added back tests for Julia >= 1.6. 👍

adrhill commented 2 years ago

This brought some improvements all around:

                                              ID                 time ratio  memory ratio
  –––––––––––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––– –––––––––––––
             ["closest color", "binary inplace"] 0.77 (5%) :whitecheckmark:     1.00 (1%)
                 ["closest color", "binary new"] 0.68 (5%) :whitecheckmark:     1.00 (1%)
              ["closest color", "color inplace"] 0.94 (5%) :whitecheckmark:     1.00 (1%)
                  ["closest color", "color new"] 0.89 (5%) :whitecheckmark:     1.00 (1%)
           ["error diffusion", "binary inplace"] 0.80 (5%) :whitecheckmark:     1.00 (1%)
               ["error diffusion", "binary new"] 0.80 (5%) :whitecheckmark:     1.00 (1%)
            ["error diffusion", "color inplace"] 0.85 (5%) :whitecheckmark: 1.62 (1%) :x:
                ["error diffusion", "color new"] 0.88 (5%) :whitecheckmark: 1.62 (1%) :x:
          ["ordered dithering", "color inplace"] 0.91 (5%) :whitecheckmark: 1.02 (1%) :x:
              ["ordered dithering", "color new"] 0.81 (5%) :whitecheckmark: 1.01 (1%) :x:
       ["threshold dithering", "binary inplace"] 0.86 (5%) :whitecheckmark:     1.00 (1%)
           ["threshold dithering", "binary new"] 0.90 (5%) :whitecheckmark:     1.00 (1%)
  ["threshold dithering", "per-channel inplace"] 0.94 (5%) :whitecheckmark:     1.00 (1%)
      ["threshold dithering", "per-channel new"] 0.94 (5%) :whitecheckmark:     1.00 (1%)

Error diffusion is slower because of a small bug that will be fixed in the next commit.

github-actions[bot] commented 2 years ago
Benchmark result # Judge result # Benchmark Report for */home/runner/work/DitherPunk.jl/DitherPunk.jl* ## Job Properties * Time of benchmarks: - Target: 18 Apr 2022 - 22:15 - Baseline: 18 Apr 2022 - 22:17 * Package commits: - Target: 6d327d - Baseline: 9fd57f * Julia commits: - Target: bf5349 - Baseline: bf5349 * Julia command flags: - Target: None - Baseline: None * Environment variables: - Target: None - Baseline: None ## Results A ratio greater than `1.0` denotes a possible regression (marked with :x:), while a ratio less than `1.0` denotes a possible improvement (marked with :white_check_mark:). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds). | ID | time ratio | memory ratio | |--------------------------------------------------|---------------|---------------| | `["closest color", "binary inplace"]` | 1.50 (5%) :x: | 1.00 (1%) | | `["closest color", "binary new"]` | 1.53 (5%) :x: | 1.00 (1%) | | `["error diffusion", "color inplace"]` | 1.21 (5%) :x: | 2.33 (1%) :x: | | `["error diffusion", "color new"]` | 1.01 (5%) | 1.03 (1%) :x: | | `["ordered dithering", "color inplace"]` | 1.11 (5%) :x: | 1.00 (1%) | | `["ordered dithering", "color new"]` | 1.11 (5%) :x: | 1.00 (1%) | | `["threshold dithering", "binary inplace"]` | 1.51 (5%) :x: | 1.00 (1%) | | `["threshold dithering", "binary new"]` | 1.45 (5%) :x: | 1.00 (1%) | ## Benchmark Group List Here's a list of all the benchmark groups executed by this job: - `["closest color"]` - `["error diffusion"]` - `["ordered dithering"]` - `["threshold dithering"]` ## Julia versioninfo ### Target ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 730 s 1 s 139 s 4980 s 0 s #2 2593 MHz 3207 s 1 s 189 s 2491 s 0 s Memory: 6.783607482910156 GB (3302.85546875 MB free) Uptime: 591.82 sec Load Avg: 1.0 0.87 0.46 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` ### Baseline ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 838 s 1 s 147 s 6141 s 0 s #2 2593 MHz 4381 s 1 s 203 s 2584 s 0 s Memory: 6.783607482910156 GB (3114.2890625 MB free) Uptime: 720.01 sec Load Avg: 1.0 0.92 0.54 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` --- # Target result # Benchmark Report for */home/runner/work/DitherPunk.jl/DitherPunk.jl* ## Job Properties * Time of benchmark: 18 Apr 2022 - 22:15 * Package commit: 6d327d * Julia commit: bf5349 * Julia command flags: None * Environment variables: None ## Results Below is a table of this job's results, obtained by running the benchmarks. The values listed in the `ID` column have the structure `[parent_group, child_group, ..., key]`, and can be used to index into the BaseBenchmarks suite to retrieve the corresponding benchmarks. The percentages accompanying time and memory values in the below table are noise tolerances. The "true" time/memory value for a given benchmark is expected to fall within this percentage of the reported value. An empty cell means that the value was zero. | ID | time | GC time | memory | allocations | |--------------------------------------------------|----------------:|----------:|----------------:|------------:| | `["closest color", "binary inplace"]` | 9.534 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "binary new"]` | 7.825 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "color inplace"]` | 145.616 ms (5%) | | 36.50 MiB (1%) | 2359336 | | `["closest color", "color new"]` | 147.503 ms (5%) | | 36.48 MiB (1%) | 2357848 | | `["closest color", "per-channel inplace"]` | 1.116 ms (5%) | | 192.05 KiB (1%) | 2 | | `["closest color", "per-channel new"]` | 1.096 ms (5%) | | 192.05 KiB (1%) | 2 | | `["error diffusion", "binary inplace"]` | 875.611 μs (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "binary new"]` | 876.310 μs (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "color inplace"]` | 148.659 ms (5%) | | 37.25 MiB (1%) | 2359340 | | `["error diffusion", "color new"]` | 117.387 ms (5%) | | 16.44 MiB (1%) | 995660 | | `["error diffusion", "per-channel inplace"]` | 4.143 ms (5%) | | 960.42 KiB (1%) | 11 | | `["error diffusion", "per-channel new"]` | 4.145 ms (5%) | | 960.42 KiB (1%) | 11 | | `["ordered dithering", "binary inplace"]` | 116.001 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "binary new"]` | 109.901 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "color inplace"]` | 704.548 ms (5%) | 27.949 ms | 247.57 MiB (1%) | 14417967 | | `["ordered dithering", "color new"]` | 829.924 ms (5%) | 41.150 ms | 281.61 MiB (1%) | 16473468 | | `["ordered dithering", "per-channel inplace"]` | 1.236 ms (5%) | | 207.98 KiB (1%) | 11 | | `["ordered dithering", "per-channel new"]` | 1.214 ms (5%) | | 207.98 KiB (1%) | 11 | | `["threshold dithering", "binary inplace"]` | 16.901 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "binary new"]` | 17.001 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "per-channel inplace"]` | 1.146 ms (5%) | | 384.38 KiB (1%) | 8 | | `["threshold dithering", "per-channel new"]` | 1.126 ms (5%) | | 384.38 KiB (1%) | 8 | ## Benchmark Group List Here's a list of all the benchmark groups executed by this job: - `["closest color"]` - `["error diffusion"]` - `["ordered dithering"]` - `["threshold dithering"]` ## Julia versioninfo ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 730 s 1 s 139 s 4980 s 0 s #2 2593 MHz 3207 s 1 s 189 s 2491 s 0 s Memory: 6.783607482910156 GB (3302.85546875 MB free) Uptime: 591.82 sec Load Avg: 1.0 0.87 0.46 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` --- # Baseline result # Benchmark Report for */home/runner/work/DitherPunk.jl/DitherPunk.jl* ## Job Properties * Time of benchmark: 18 Apr 2022 - 22:17 * Package commit: 9fd57f * Julia commit: bf5349 * Julia command flags: None * Environment variables: None ## Results Below is a table of this job's results, obtained by running the benchmarks. The values listed in the `ID` column have the structure `[parent_group, child_group, ..., key]`, and can be used to index into the BaseBenchmarks suite to retrieve the corresponding benchmarks. The percentages accompanying time and memory values in the below table are noise tolerances. The "true" time/memory value for a given benchmark is expected to fall within this percentage of the reported value. An empty cell means that the value was zero. | ID | time | GC time | memory | allocations | |--------------------------------------------------|----------------:|----------:|----------------:|------------:| | `["closest color", "binary inplace"]` | 6.367 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "binary new"]` | 5.100 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "color inplace"]` | 145.484 ms (5%) | | 36.48 MiB (1%) | 2357848 | | `["closest color", "color new"]` | 147.330 ms (5%) | | 36.48 MiB (1%) | 2357848 | | `["closest color", "per-channel inplace"]` | 1.115 ms (5%) | | 192.05 KiB (1%) | 2 | | `["closest color", "per-channel new"]` | 1.096 ms (5%) | | 192.05 KiB (1%) | 2 | | `["error diffusion", "binary inplace"]` | 885.811 μs (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "binary new"]` | 878.611 μs (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "color inplace"]` | 122.945 ms (5%) | | 16.01 MiB (1%) | 995660 | | `["error diffusion", "color new"]` | 115.745 ms (5%) | | 16.01 MiB (1%) | 995660 | | `["error diffusion", "per-channel inplace"]` | 4.169 ms (5%) | | 960.42 KiB (1%) | 11 | | `["error diffusion", "per-channel new"]` | 4.175 ms (5%) | | 960.42 KiB (1%) | 11 | | `["ordered dithering", "binary inplace"]` | 115.101 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "binary new"]` | 109.901 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "color inplace"]` | 632.103 ms (5%) | 14.353 ms | 247.07 MiB (1%) | 14417965 | | `["ordered dithering", "color new"]` | 750.053 ms (5%) | 20.058 ms | 281.11 MiB (1%) | 16473466 | | `["ordered dithering", "per-channel inplace"]` | 1.236 ms (5%) | | 207.98 KiB (1%) | 11 | | `["ordered dithering", "per-channel new"]` | 1.216 ms (5%) | | 207.98 KiB (1%) | 11 | | `["threshold dithering", "binary inplace"]` | 11.200 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "binary new"]` | 11.700 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "per-channel inplace"]` | 1.146 ms (5%) | | 384.38 KiB (1%) | 8 | | `["threshold dithering", "per-channel new"]` | 1.124 ms (5%) | | 384.38 KiB (1%) | 8 | ## Benchmark Group List Here's a list of all the benchmark groups executed by this job: - `["closest color"]` - `["error diffusion"]` - `["ordered dithering"]` - `["threshold dithering"]` ## Julia versioninfo ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 838 s 1 s 147 s 6141 s 0 s #2 2593 MHz 4381 s 1 s 203 s 2584 s 0 s Memory: 6.783607482910156 GB (3114.2890625 MB free) Uptime: 720.01 sec Load Avg: 1.0 0.92 0.54 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` --- # Runtime information | Runtime Info | | |:--|:--| | BLAS #threads | 2 | | `BLAS.vendor()` | `openblas64` | | `Sys.CPU_THREADS` | 2 | `lscpu` output: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 46 bits physical, 48 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Stepping: 7 CPU MHz: 2593.907 BogoMIPS: 5187.81 Hypervisor vendor: Microsoft Virtualization type: full L1d cache: 64 KiB L1i cache: 64 KiB L2 cache: 2 MiB L3 cache: 35.8 MiB NUMA node0 CPU(s): 0,1 Vulnerability Itlb multihit: KVM: Mitigation: VMX unsupported Vulnerability L1tf: Mitigation; PTE Inversion Vulnerability Mds: Mitigation; Clear CPU buffers; SMT Host state unknown Vulnerability Meltdown: Mitigation; PTI Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT Host state unknown Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear | Cpu Property | Value | |:------------------ |:------------------------------------------------------- | | Brand | Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz | | Vendor | :Intel | | Architecture | :Skylake | | Model | Family: 0x06, Model: 0x55, Stepping: 0x07, Type: 0x00 | | Cores | 2 physical cores, 2 logical cores (on executing CPU) | | | No Hyperthreading hardware capability detected | | Clock Frequencies | Not supported by CPU | | Data Cache | Level 1:3 : (32, 1024, 36608) kbytes | | | 64 byte cache line size | | Address Size | 48 bits virtual, 46 bits physical | | SIMD | 512 bit = 64 byte max. SIMD vector size | | Time Stamp Counter | TSC is accessible via `rdtsc` | | | TSC increased at every clock cycle (non-invariant TSC) | | Perf. Monitoring | Performance Monitoring Counters (PMC) are not supported | | Hypervisor | Yes, Microsoft |
adrhill commented 2 years ago

The benchmarks are very noisy even locally. Maybe 256x256 test images are too small? At least the higher memory usage is now fixed.

github-actions[bot] commented 2 years ago
Benchmark result # Judge result # Benchmark Report for */home/runner/work/DitherPunk.jl/DitherPunk.jl* ## Job Properties * Time of benchmarks: - Target: 18 Apr 2022 - 22:32 - Baseline: 18 Apr 2022 - 22:34 * Package commits: - Target: 445c56 - Baseline: 9fd57f * Julia commits: - Target: bf5349 - Baseline: bf5349 * Julia command flags: - Target: None - Baseline: None * Environment variables: - Target: None - Baseline: None ## Results A ratio greater than `1.0` denotes a possible regression (marked with :x:), while a ratio less than `1.0` denotes a possible improvement (marked with :white_check_mark:). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds). | ID | time ratio | memory ratio | |--------------------------------------------------|---------------|---------------| | `["closest color", "binary inplace"]` | 1.23 (5%) :x: | 1.00 (1%) | | `["closest color", "binary new"]` | 1.43 (5%) :x: | 1.00 (1%) | | `["error diffusion", "binary inplace"]` | 1.25 (5%) :x: | 1.00 (1%) | | `["error diffusion", "binary new"]` | 1.26 (5%) :x: | 1.00 (1%) | | `["error diffusion", "color inplace"]` | 1.20 (5%) :x: | 2.30 (1%) :x: | | `["ordered dithering", "color inplace"]` | 1.16 (5%) :x: | 1.00 (1%) | | `["ordered dithering", "color new"]` | 1.13 (5%) :x: | 1.00 (1%) | | `["threshold dithering", "binary inplace"]` | 1.20 (5%) :x: | 1.00 (1%) | | `["threshold dithering", "binary new"]` | 1.32 (5%) :x: | 1.00 (1%) | ## Benchmark Group List Here's a list of all the benchmark groups executed by this job: - `["closest color"]` - `["error diffusion"]` - `["ordered dithering"]` - `["threshold dithering"]` ## Julia versioninfo ### Target ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 3169 s 1 s 171 s 2044 s 0 s #2 2593 MHz 626 s 1 s 141 s 4632 s 0 s Memory: 6.783611297607422 GB (3210.12109375 MB free) Uptime: 543.77 sec Load Avg: 1.02 0.84 0.42 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` ### Baseline ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 4313 s 1 s 183 s 2118 s 0 s #2 2593 MHz 705 s 1 s 146 s 5777 s 0 s Memory: 6.783611297607422 GB (3383.75390625 MB free) Uptime: 666.84 sec Load Avg: 1.0 0.9 0.5 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` --- # Target result # Benchmark Report for */home/runner/work/DitherPunk.jl/DitherPunk.jl* ## Job Properties * Time of benchmark: 18 Apr 2022 - 22:32 * Package commit: 445c56 * Julia commit: bf5349 * Julia command flags: None * Environment variables: None ## Results Below is a table of this job's results, obtained by running the benchmarks. The values listed in the `ID` column have the structure `[parent_group, child_group, ..., key]`, and can be used to index into the BaseBenchmarks suite to retrieve the corresponding benchmarks. The percentages accompanying time and memory values in the below table are noise tolerances. The "true" time/memory value for a given benchmark is expected to fall within this percentage of the reported value. An empty cell means that the value was zero. | ID | time | GC time | memory | allocations | |--------------------------------------------------|----------------:|----------:|----------------:|------------:| | `["closest color", "binary inplace"]` | 7.020 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "binary new"]` | 5.657 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "color inplace"]` | 148.719 ms (5%) | | 36.50 MiB (1%) | 2359336 | | `["closest color", "color new"]` | 147.507 ms (5%) | | 36.48 MiB (1%) | 2357848 | | `["closest color", "per-channel inplace"]` | 1.111 ms (5%) | | 192.05 KiB (1%) | 2 | | `["closest color", "per-channel new"]` | 1.096 ms (5%) | | 192.05 KiB (1%) | 2 | | `["error diffusion", "binary inplace"]` | 1.081 ms (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "binary new"]` | 1.077 ms (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "color inplace"]` | 147.321 ms (5%) | | 36.81 MiB (1%) | 2359340 | | `["error diffusion", "color new"]` | 115.746 ms (5%) | | 16.01 MiB (1%) | 995660 | | `["error diffusion", "per-channel inplace"]` | 4.299 ms (5%) | | 960.42 KiB (1%) | 11 | | `["error diffusion", "per-channel new"]` | 4.310 ms (5%) | | 960.42 KiB (1%) | 11 | | `["ordered dithering", "binary inplace"]` | 114.800 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "binary new"]` | 109.700 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "color inplace"]` | 731.031 ms (5%) | 32.620 ms | 247.07 MiB (1%) | 14417965 | | `["ordered dithering", "color new"]` | 831.198 ms (5%) | 31.900 ms | 281.11 MiB (1%) | 16473466 | | `["ordered dithering", "per-channel inplace"]` | 1.231 ms (5%) | | 207.98 KiB (1%) | 11 | | `["ordered dithering", "per-channel new"]` | 1.215 ms (5%) | | 207.98 KiB (1%) | 11 | | `["threshold dithering", "binary inplace"]` | 13.100 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "binary new"]` | 11.100 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "per-channel inplace"]` | 1.130 ms (5%) | | 384.38 KiB (1%) | 8 | | `["threshold dithering", "per-channel new"]` | 1.118 ms (5%) | | 384.38 KiB (1%) | 8 | ## Benchmark Group List Here's a list of all the benchmark groups executed by this job: - `["closest color"]` - `["error diffusion"]` - `["ordered dithering"]` - `["threshold dithering"]` ## Julia versioninfo ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 3169 s 1 s 171 s 2044 s 0 s #2 2593 MHz 626 s 1 s 141 s 4632 s 0 s Memory: 6.783611297607422 GB (3210.12109375 MB free) Uptime: 543.77 sec Load Avg: 1.02 0.84 0.42 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` --- # Baseline result # Benchmark Report for */home/runner/work/DitherPunk.jl/DitherPunk.jl* ## Job Properties * Time of benchmark: 18 Apr 2022 - 22:34 * Package commit: 9fd57f * Julia commit: bf5349 * Julia command flags: None * Environment variables: None ## Results Below is a table of this job's results, obtained by running the benchmarks. The values listed in the `ID` column have the structure `[parent_group, child_group, ..., key]`, and can be used to index into the BaseBenchmarks suite to retrieve the corresponding benchmarks. The percentages accompanying time and memory values in the below table are noise tolerances. The "true" time/memory value for a given benchmark is expected to fall within this percentage of the reported value. An empty cell means that the value was zero. | ID | time | GC time | memory | allocations | |--------------------------------------------------|----------------:|----------:|----------------:|------------:| | `["closest color", "binary inplace"]` | 5.720 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "binary new"]` | 3.943 μs (5%) | | 64.11 KiB (1%) | 2 | | `["closest color", "color inplace"]` | 145.067 ms (5%) | | 36.48 MiB (1%) | 2357848 | | `["closest color", "color new"]` | 147.154 ms (5%) | | 36.48 MiB (1%) | 2357848 | | `["closest color", "per-channel inplace"]` | 1.108 ms (5%) | | 192.05 KiB (1%) | 2 | | `["closest color", "per-channel new"]` | 1.096 ms (5%) | | 192.05 KiB (1%) | 2 | | `["error diffusion", "binary inplace"]` | 863.006 μs (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "binary new"]` | 857.006 μs (5%) | | 320.23 KiB (1%) | 5 | | `["error diffusion", "color inplace"]` | 122.811 ms (5%) | | 16.01 MiB (1%) | 995660 | | `["error diffusion", "color new"]` | 115.344 ms (5%) | | 16.01 MiB (1%) | 995660 | | `["error diffusion", "per-channel inplace"]` | 4.095 ms (5%) | | 960.42 KiB (1%) | 11 | | `["error diffusion", "per-channel new"]` | 4.113 ms (5%) | | 960.42 KiB (1%) | 11 | | `["ordered dithering", "binary inplace"]` | 113.801 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "binary new"]` | 109.600 μs (5%) | | 69.42 KiB (1%) | 5 | | `["ordered dithering", "color inplace"]` | 628.458 ms (5%) | 9.795 ms | 247.07 MiB (1%) | 14417965 | | `["ordered dithering", "color new"]` | 738.096 ms (5%) | 14.256 ms | 281.11 MiB (1%) | 16473466 | | `["ordered dithering", "per-channel inplace"]` | 1.225 ms (5%) | | 207.98 KiB (1%) | 11 | | `["ordered dithering", "per-channel new"]` | 1.215 ms (5%) | | 207.98 KiB (1%) | 11 | | `["threshold dithering", "binary inplace"]` | 10.900 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "binary new"]` | 8.400 μs (5%) | | 128.27 KiB (1%) | 7 | | `["threshold dithering", "per-channel inplace"]` | 1.118 ms (5%) | | 384.38 KiB (1%) | 8 | | `["threshold dithering", "per-channel new"]` | 1.108 ms (5%) | | 384.38 KiB (1%) | 8 | ## Benchmark Group List Here's a list of all the benchmark groups executed by this job: - `["closest color"]` - `["error diffusion"]` - `["ordered dithering"]` - `["threshold dithering"]` ## Julia versioninfo ``` Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) Ubuntu 20.04.4 LTS uname: Linux 5.13.0-1021-azure #24~20.04.1-Ubuntu SMP Tue Mar 29 15:34:22 UTC 2022 x86_64 x86_64 CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: speed user nice sys idle irq #1 2593 MHz 4313 s 1 s 183 s 2118 s 0 s #2 2593 MHz 705 s 1 s 146 s 5777 s 0 s Memory: 6.783611297607422 GB (3383.75390625 MB free) Uptime: 666.84 sec Load Avg: 1.0 0.9 0.5 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512) ``` --- # Runtime information | Runtime Info | | |:--|:--| | BLAS #threads | 2 | | `BLAS.vendor()` | `openblas64` | | `Sys.CPU_THREADS` | 2 | `lscpu` output: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 46 bits physical, 48 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Stepping: 7 CPU MHz: 2593.906 BogoMIPS: 5187.81 Hypervisor vendor: Microsoft Virtualization type: full L1d cache: 64 KiB L1i cache: 64 KiB L2 cache: 2 MiB L3 cache: 35.8 MiB NUMA node0 CPU(s): 0,1 Vulnerability Itlb multihit: KVM: Mitigation: VMX unsupported Vulnerability L1tf: Mitigation; PTE Inversion Vulnerability Mds: Mitigation; Clear CPU buffers; SMT Host state unknown Vulnerability Meltdown: Mitigation; PTI Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT Host state unknown Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear | Cpu Property | Value | |:------------------ |:------------------------------------------------------- | | Brand | Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz | | Vendor | :Intel | | Architecture | :Skylake | | Model | Family: 0x06, Model: 0x55, Stepping: 0x07, Type: 0x00 | | Cores | 2 physical cores, 2 logical cores (on executing CPU) | | | No Hyperthreading hardware capability detected | | Clock Frequencies | Not supported by CPU | | Data Cache | Level 1:3 : (32, 1024, 36608) kbytes | | | 64 byte cache line size | | Address Size | 48 bits virtual, 46 bits physical | | SIMD | 512 bit = 64 byte max. SIMD vector size | | Time Stamp Counter | TSC is accessible via `rdtsc` | | | TSC increased at every clock cycle (non-invariant TSC) | | Perf. Monitoring | Performance Monitoring Counters (PMC) are not supported | | Hypervisor | Yes, Microsoft |
adrhill commented 2 years ago

The benchmarks are very noisy even locally.

Here are the results from two local runs:

                                      ID                 time ratio memory ratio
  –––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––– ––––––––––––
     ["closest color", "binary inplace"]              1.10 (5%) :x:    1.00 (1%)
         ["closest color", "binary new"]              1.14 (5%) :x:    1.00 (1%)
    ["error diffusion", "color inplace"]              1.06 (5%) :x:    1.00 (1%)
     ["ordered dithering", "binary new"] 0.94 (5%) :whitecheckmark:    1.00 (1%)
  ["ordered dithering", "color inplace"]              1.05 (5%) :x:    1.00 (1%)
                                          ID                 time ratio memory ratio
  –––––––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––– ––––––––––––
         ["closest color", "binary inplace"]              1.07 (5%) :x:    1.00 (1%)
             ["closest color", "binary new"] 0.63 (5%) :whitecheckmark:    1.00 (1%)
       ["error diffusion", "binary inplace"]              1.16 (5%) :x:    1.00 (1%)
           ["error diffusion", "binary new"]              1.19 (5%) :x:    1.00 (1%)
        ["error diffusion", "color inplace"] 0.90 (5%) :whitecheckmark:    1.00 (1%)
  ["error diffusion", "per-channel inplace"] 0.95 (5%) :whitecheckmark:    1.00 (1%)
      ["error diffusion", "per-channel new"] 0.94 (5%) :whitecheckmark:    1.00 (1%)
   ["threshold dithering", "binary inplace"]              1.11 (5%) :x:    1.00 (1%)
       ["threshold dithering", "binary new"] 0.78 (5%) :whitecheckmark:    1.00 (1%)

Maybe this didn't increase performance but it also didn't hurt it.