JuliaPlots/Plots.jl

[FR] Improve performance of plotting heatmaps

Open

#4,520 创建于 2022年11月15日

在 GitHub 查看
 (13 评论) (1 反应) (0 负责人)Julia (1,943 star) (381 fork)batch import
help wantedperformance

描述

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

贡献者指南

[FR] Improve performance of plotting heatmaps · JuliaPlots/Plots.jl#4520 | Good First Issue