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

Fix CairoMakie line color bug #3704 #3712

Merged
merged 3 commits into from Mar 18, 2024
Merged

Fix CairoMakie line color bug #3704 #3712

merged 3 commits into from Mar 18, 2024

Conversation

jkrumbiegel
Copy link
Collaborator

Fix #3704, a logic bug for the case where a line contains the same color multiple times. In this case, the drawing should be delayed to have as few separate draw calls as possible, but of course the whole line should not be drawn with the following color gradient. Curious that this didn't come up earlier because it's very obviously wrong.

lines(1:10, sin, color = [fill(0, 9); fill(1, 1)], linewidth = 3, colormap = [:red, :cyan])

Before:

image

After:

image

@MakieBot
Copy link
Collaborator

MakieBot commented Mar 18, 2024

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(fig)
using create display create display
GLMakie 3.32s (3.30, 3.38) 0.03+- 162.82ms (161.85, 164.86) 1.01+- 463.38ms (461.83, 464.78) 1.09+- 7.28ms (7.17, 7.35) 0.06+- 25.44ms (25.37, 25.58) 0.07+-
master 3.32s (3.29, 3.36) 0.02+- 164.24ms (161.48, 172.58) 3.80+- 466.12ms (459.42, 477.82) 5.77+- 7.22ms (7.13, 7.27) 0.05+- 25.40ms (25.38, 25.42) 0.02+-
evaluation 1.00x invariant, 0.0s (0.06d, 0.91p, 0.03std) 1.01x invariant, -1.41ms (-0.51d, 0.37p, 2.41std) 1.01x invariant, -2.74ms (-0.66d, 0.26p, 3.43std) 0.99x slower X, 0.07ms (1.18d, 0.05p, 0.06std) 1.00x invariant, 0.04ms (0.77d, 0.19p, 0.04std)
CairoMakie 3.05s (2.97, 3.11) 0.06+- 176.89ms (166.61, 197.99) 11.73+- 108.79ms (100.71, 129.50) 9.88+- 7.42ms (7.27, 7.50) 0.08+- 886.94μs (882.12, 893.26) 3.63+-
master 3.04s (3.02, 3.06) 0.02+- 170.12ms (165.94, 175.22) 3.29+- 105.50ms (101.49, 111.95) 4.48+- 7.25ms (7.13, 7.36) 0.09+- 880.98μs (873.95, 887.11) 4.72+-
evaluation 1.00x invariant, 0.01s (0.15d, 0.79p, 0.04std) 0.96x invariant, 6.77ms (0.79d, 0.19p, 7.51std) 0.97x invariant, 3.29ms (0.43d, 0.44p, 7.18std) 0.98x slower X, 0.18ms (2.01d, 0.00p, 0.09std) 0.99x slower X, 5.96μs (1.42d, 0.02p, 4.18std)
WGLMakie 3.61s (3.56, 3.66) 0.04+- 373.91ms (368.10, 382.83) 6.04+- 8.61s (8.50, 8.93) 0.15+- 9.47ms (9.11, 10.12) 0.36+- 72.88ms (68.30, 97.07) 10.67+-
master 3.59s (3.55, 3.70) 0.05+- 228.78ms (163.11, 376.48) 98.04+- 8.74s (8.50, 9.03) 0.20+- 9.36ms (9.12, 9.78) 0.22+- 68.75ms (67.86, 70.14) 0.78+-
evaluation 1.00x invariant, 0.01s (0.32d, 0.57p, 0.05std) 0.61x slower❌, 145.13ms (2.09d, 0.01p, 52.04std) 1.02x invariant, -0.13s (-0.74d, 0.19p, 0.17std) 0.99x invariant, 0.1ms (0.35d, 0.53p, 0.29std) 0.94x noisy🤷‍♀️, 4.13ms (0.55d, 0.35p, 5.73std)

@jkrumbiegel jkrumbiegel merged commit 3afefb4 into master Mar 18, 2024
18 checks passed
@jkrumbiegel jkrumbiegel deleted the jk/fix-3704 branch March 18, 2024 08:56
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

Successfully merging this pull request may close these issues.

Varying line colors in CairoMakie
2 participants