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

loss of performance for complex valued Kronecker products #151

Open
vsaase opened this issue Jan 5, 2021 · 0 comments
Open

loss of performance for complex valued Kronecker products #151

vsaase opened this issue Jan 5, 2021 · 0 comments

Comments

@vsaase
Copy link

vsaase commented Jan 5, 2021

Hi, here are some benchmark, seems there are inefficient allocations when using complex values:

using LazyArrays
using BenchmarkTools

spd=ones(1000,1000)
A=ones(2,2)
B=kron(spd,A)
Bi=kron(spd,im*A)
Bla = ApplyArray(kron, spd, A)
Blai = ApplyArray(kron, spd, im*A)
x=ones(2000)

@btime B*x;
# julia> @btime B*x
#   1.368 ms (1 allocation: 15.75 KiB)

@btime Bla*x;
# julia> @btime Bla*x;
#   471.707 μs (6 allocations: 31.67 KiB)

@btime Bi*x;
# julia> @btime Bi*x;
#   3.128 ms (4 allocations: 62.66 KiB)

@btime Blai*x;
# julia> @btime Blai*x;
#   32.775 ms (3112 allocations: 8.04 MiB)

thanks,
Victor

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

1 participant