JuliaPlots/Plots.jl

[FR] Improve performance of plotting heatmaps

Open

#4.520 aberto em 15 de nov. de 2022

Ver no GitHub
 (13 comments) (1 reaction) (0 assignees)Julia (381 forks)batch import
help wantedperformance

Métricas do repositório

Stars
 (1.943 stars)
Métricas de merge de PR
 (Mesclagem média 13d 6h) (2 fundiu PRs em 30d)

Description

Reported on Slack by Jesse Chan, repeated calls to plot! to produce overlying heatmaps was very slow.

const mat = randn(512, 512)

function f(x, n)
    plot()
    for _ in 1:n
        heatmap!(x)
    end
end

f(mat, 100)

Allocation profiler shows the large majority of allocations occurring in heatmap_edges: image

And the large majority of computation time in expand_extrema! (which calls heatmap_edges) and update_clims (my old nemesis): image

Guia do colaborador