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

Matrix difference extremely slow #112

Closed
biona001 opened this issue Jul 28, 2022 · 1 comment · Fixed by #113
Closed

Matrix difference extremely slow #112

biona001 opened this issue Jul 28, 2022 · 1 comment · Fixed by #113

Comments

@biona001
Copy link

biona001 commented Jul 28, 2022

Hi,

I noticed that a BlockDiagonal minus a dense matrix is very slow with v.0.1.35

bd = BlockDiagonal([rand(5, 5) for _ in 1:100])
dense1 = rand(500, 500)
dense2 = rand(500, 500)

@time bd - dense1
@time dense2 - dense1;

  0.219396 seconds (495.00 k allocations: 134.660 MiB, 16.69% gc time)
  0.000613 seconds (2 allocations: 1.907 MiB)

But interestingly, addition and multiplication is okay (in fact blockdiagonal is faster, as I would expect)

@time bd + dense1
@time dense2 + dense1;

  0.000377 seconds (102 allocations: 1.935 MiB)
  0.000646 seconds (2 allocations: 1.907 MiB)
@time bd * dense1
@time dense2 * dense1;

  0.002117 seconds (800 allocations: 3.850 MiB)
  0.008553 seconds (2 allocations: 1.907 MiB)

Might be related to #101

@mzgubic
Copy link
Collaborator

mzgubic commented Jul 28, 2022

Thanks for opening these performance issues, please keep them coming 🙂

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

Successfully merging a pull request may close this issue.

2 participants