Skip to content

Linear solves are consistently slower and more memory-heavy? #287

Open
@mkasiulis

Description

@mkasiulis

Hi,

I've been trying to use LazyArrays for large linear solves, but it seems that even examples from the readme are both slower and more memory-heavy than just base solve for explicit arrays.

For instance,

A = randn(5,5); b = randn(5); c = similar(b);
@btime c .= @~ A \ b
@btime c .= applied(\, A, b)
@btime c .= Ldiv(A, b)
@btime c .= A \ b

returns, on one example run:

3.877 μs (33 allocations: 1.70 KiB)
3.851 μs (32 allocations: 1.67 KiB)
1.280 μs (11 allocations: 832 bytes)
388.098 ns (4 allocations: 464 bytes)

I am not surprised that it takes longer to use lazy arrays, but is there any way to decrease memory use here?

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