Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented May 30, 2025

Avoids hitting slow generic methods.
Discussed in https://discourse.julialang.org/t/very-long-time-for-addition-of-complex-identity-matrix-to-transposed-sparse-matrix/129465.
After this, the following are comparable:

julia> A = sprandn(90, 90, 0.01);

julia> @btime ($A + complex(0,1.) * I);
  1.313 μs (13 allocations: 8.02 KiB)

julia> @btime (transpose($A) + complex(0,1.) * I);
  1.416 μs (13 allocations: 8.02 KiB)

@codecov
Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.75%. Comparing base (c4a477f) to head (d4201d6).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1366      +/-   ##
==========================================
- Coverage   93.75%   93.75%   -0.01%     
==========================================
  Files          34       34              
  Lines       15724    15732       +8     
==========================================
+ Hits        14742    14749       +7     
- Misses        982      983       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stevengj
Copy link
Member

LGTM. Is there any concern over changing the type of the result of A' + I?

@jishnub
Copy link
Member Author

jishnub commented May 31, 2025

I don't think this is much of a concern. The return types aren't guaranteed across releases, and one often needs to refine these for performance.

@jishnub jishnub merged commit 5f449f5 into master Jun 1, 2025
4 checks passed
@jishnub jishnub deleted the jishnub/uniformscaling_add branch June 1, 2025 13:53
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 this pull request may close these issues.

2 participants