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

Reduce allocs for beamformers #46

Merged
merged 10 commits into from
Oct 23, 2024
Merged

Conversation

microcassidy
Copy link
Contributor

Hello,
Thanks for making such an easy-to-use library.

I have made some changes to reduce the allocations for the Capon, MUSIC, and Bartlett beamformer functions.
Perhaps it might be useful to you too.

All the best,

M

@mchitre mchitre self-requested a review October 22, 2024 03:36
@mchitre
Copy link
Member

mchitre commented Oct 22, 2024

Thanks for the contribution. Will review changes shortly.

@microcassidy
Copy link
Contributor Author

Another thing that I noticed though was that Precompile tools runs the test workload for the package. The time to first execution is longer because test is a dependency of both the library and the test. If you remove the test decency from the source, test is only called on running test, so it ends up being quicker for development and compilation on both sides. The only thing that's slower is running test

@microcassidy
Copy link
Contributor Author

https://github.com/org-arl/SignalAnalysis.jl/actions/runs/11425445079/job/31864162141#step:5:152

@mchitre
Copy link
Member

mchitre commented Oct 22, 2024

I added the tests in precompile a while back to force pre-compilation caching of commonly used methods. I do recognize that it slows down the installation of the package, and in case of running tests, runs them twice. I intend to fix that by changing the running of tests during package init to just loading the precompile statements instead.

@mchitre
Copy link
Member

mchitre commented Oct 22, 2024

Copy link
Member

@mchitre mchitre left a comment

Choose a reason for hiding this comment

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

Looks great. Made minor suggestions to replace allocation with zeros followed by filling array with direct computation of array.

src/array.jl Outdated Show resolved Hide resolved
src/array.jl Outdated Show resolved Hide resolved
src/array.jl Outdated Show resolved Hide resolved
@microcassidy
Copy link
Contributor Author

microcassidy commented Oct 22, 2024 via email

Copy link
Member

@mchitre mchitre left a comment

Choose a reason for hiding this comment

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

Almost there. One minor formatting change requested to be reverted.

src/dsp.jl Outdated Show resolved Hide resolved
@mchitre mchitre merged commit ff1beb6 into org-arl:master Oct 23, 2024
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