Skip to content

Iterator norm in isapprox for Arrays #1378

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Jun 4, 2025

This seems to improve performance, and reduces allocations:

julia> A = rand(100,100);

julia> @btime isapprox($A, $A);
  13.305 μs (3 allocations: 78.21 KiB) # master
  8.063 μs (0 allocations: 0 bytes) # this PR

julia> A = rand(5000,5000);

julia> @btime isapprox($A, $A);
  106.003 ms (3 allocations: 190.74 MiB) # master
  43.122 ms (0 allocations: 0 bytes) # this PR

Currently, this is only specialized for Arrays, but this may be extended to StridedArrays after JuliaLang/julia#58635. In the future, the new function may be specialized for structured matrix types to only iterate over filled bands.

Copy link

codecov bot commented Jun 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.81%. Comparing base (0116878) to head (35c5dd3).
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1378   +/-   ##
=======================================
  Coverage   93.81%   93.81%           
=======================================
  Files          34       34           
  Lines       15717    15722    +5     
=======================================
+ Hits        14745    14750    +5     
  Misses        972      972           

☔ 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.

@jishnub jishnub force-pushed the jishnub/isapprox branch from 7457d72 to 4906add Compare June 13, 2025 15:03
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.

1 participant