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

general cleanups #536

Merged
merged 31 commits into from
Feb 26, 2024
Merged

general cleanups #536

merged 31 commits into from
Feb 26, 2024

Conversation

wheeheee
Copy link
Member

@wheeheee wheeheee commented Feb 8, 2024

  • named exceptions (DomainError, ArgumentError etc.)
  • findmin, splice! etc.
  • tidy some things up
  • fixes some type instabilities in periodogram functions?

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: Patch coverage is 99.62825% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 97.79%. Comparing base (10a7c1e) to head (dc9a4bb).

Files Patch % Lines
src/periodograms.jl 98.46% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #536      +/-   ##
==========================================
+ Coverage   97.58%   97.79%   +0.20%     
==========================================
  Files          18       18              
  Lines        3147     3127      -20     
==========================================
- Hits         3071     3058      -13     
+ Misses         76       69       -7     

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

@ViralBShah
Copy link
Contributor

ViralBShah commented Feb 8, 2024

Is it worth reviewing open PRs to see if there are any that should be merged before this, since this PR may create merge conflicts?

@wheeheee
Copy link
Member Author

wheeheee commented Feb 8, 2024

PR #502 certainly would, although it looks relatively easy to resolve. Would it be useful to create a milestone for the next release? That would make it a little easier to see which PRs (that are likely to be merged) might create problems.
Or I could just rebase and fix nearer to the end?

@ViralBShah
Copy link
Contributor

I think it should be fine to make a milestone, if that helps manage the PRs.

@wheeheee
Copy link
Member Author

wheeheee commented Feb 8, 2024

Ok, I've created the milestone and added a few PRs to it

@ViralBShah
Copy link
Contributor

Should this PR also be on the milestone?

@wheeheee wheeheee added this to the 0.8 milestone Feb 8, 2024
@ViralBShah
Copy link
Contributor

It's a bit annoying that CI is failing here because of a small codecov thing.

@wheeheee wheeheee force-pushed the misc branch 2 times, most recently from b35a2df to 8549498 Compare February 12, 2024 09:00
Copy link
Member

@martinholters martinholters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not done reviewing yet, but so far only minor nit-picking re: return.

src/Filters/coefficients.jl Outdated Show resolved Hide resolved
src/Filters/coefficients.jl Outdated Show resolved Hide resolved
src/windows.jl Outdated Show resolved Hide resolved
test/dsp.jl Outdated Show resolved Hide resolved
test/dsp.jl Outdated Show resolved Hide resolved
test/dsp.jl Outdated Show resolved Hide resolved
@wheeheee
Copy link
Member Author

I would like to rebase then merge this PR after #502, since it has gotten a little big, and I think it's easier to rebase conflicting PRs one by one on this rather than rebasing this on multiple PRs.
Of course, I'll also take care of rebasing those conflicting PRs.

Seeking opinions on whether this is a good idea.

@martinholters
Copy link
Member

I leave the rebasing to you, then take a hopefully final look and merge. How does that sound?

@inbounds out[i,j] += abs2(s_fft[i,j])*m1
end
for i in eachindex(out, s_fft)
@inbounds out[i] = abs2(s_fft[i]) * m1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this @inbounds helpful? I'd imagine the compiler can eliminate or at lest hoist it out of the loop.

Copy link
Member Author

@wheeheee wheeheee Feb 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benchmarked for 1000 x 1000 Float64 and ComplexF64 matrices. doesn't seem to matter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially tried it on v1.10, but removing it in v1.6 has a 30% performance penalty, so I think it should remain, as the eachindex ensures correctness anyway.
I also discovered the performance fix in #516, which feels like just a workaround for vectorization regressions in v1.10 and v1.9, also introduced massive performance regressions on v1.6 for me, so I would like to clarify what DSP.jl's policy on performance is; is only the latest stable version prioritized, or is performance on LTS also important enough to consider multi-versioning?

@martinholters
Copy link
Member

Have you benchmarked whether the @inlines you have added are actually beneficial?

@wheeheee
Copy link
Member Author

Have you benchmarked whether the @inlines you have added are actually beneficial?

Yes, I have them here. Not zeroing doesn't help as much as the inlining, maybe about a 10% difference, so I didn't think to include those benchmarks.
Even with the inlining, those functions don't really matter much in the grand scheme of things (for example in digitalfilter, bilinear dominates), maybe only if one makes heavy use of Butterworth and friends, or maybe a lot of Elliptic.
As always, the usual disclaimers apply about platform, hardware, etc., so I'll post mine here:

julia> versioninfo()
Julia Version 1.10.1
Commit 7790d6f064 (2024-02-13 20:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_NUM_THREADS = auto

@martinholters martinholters merged commit 93e9ee7 into JuliaDSP:master Feb 26, 2024
14 checks passed
@ViralBShah
Copy link
Contributor

Nice set of updates here!

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.

3 participants