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

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

Open
mkasiulis opened this issue Jan 9, 2024 · 1 comment
Open

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

mkasiulis opened this issue Jan 9, 2024 · 1 comment

Comments

@mkasiulis
Copy link

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?

@dlfivefifty
Copy link
Member

I guess you are saying the first two should do the same thing as the 3rd? Probably just missing special cases

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

No branches or pull requests

2 participants