Skip to content

Performance: Lowering vs. Laplacian #64

@ioannisPApapadopoulos

Description

@ioannisPApapadopoulos

A question of performance (for code that I wrote). I have noticed that creating finite subsections of matrices can sometimes be slow:

julia> Z = ZernikeAnnulus(0.5,1,1); wZ  = Weighted(Z);
julia> @time Δ = Z \ (Laplacian(axes(Z,1)) * wZ);
  0.002635 seconds (2.40 k allocations: 240.312 KiB)
julia> @time Δ[Block.(1:20),Block.(1:20)];
  0.185276 seconds (498.23 k allocations: 26.108 MiB, 8.23% gc time)

versus

julia> @time L = Z \ wZ;
  0.000005 seconds (2 allocations: 256 bytes)
julia> @time L[Block.(1:20), Block.(1:20)];
  5.623841 seconds (7.67 M allocations: 605.328 MiB, 1.50% gc time)

Even if I rewrite Z \ wZ using BroadcastVector, I get similar timings.. Any ideas @dlfivefifty?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions