Skip to content

Introduce function barrier in higher dimensional transform loop to avoid a lot of allocations.#62

Merged
dannys4 merged 3 commits intomainfrom
an/d2
Mar 26, 2025
Merged

Introduce function barrier in higher dimensional transform loop to avoid a lot of allocations.#62
dannys4 merged 3 commits intomainfrom
an/d2

Conversation

@andreasnoack
Copy link
Member

@andreasnoack andreasnoack commented Mar 25, 2025

It's not a huge overhead but the number of allocations is reduced quite a bit with just a minor code change

Current main

julia> @btime fft(x) setup=(x=complex.(randn(256,256)));
  1.615 ms (5422 allocations: 2.14 MiB)

This PR

julia> @btime fft(x) setup=(x=complex.(randn(256,256)));
  1.402 ms (45 allocations: 2.00 MiB)

@andreasnoack
Copy link
Member Author

I've added some allocation tests. Because of that, I have set the minimum version for Julia to 1.9. With 1.10 being lts, I don't think it is a big deal but let me know if you disagree and I can make the allocations conditional on the Julia version.

@dannys4
Copy link
Collaborator

dannys4 commented Mar 25, 2025

See #64

@dannys4 dannys4 added this pull request to the merge queue Mar 26, 2025
Merged via the queue into main with commit 55a9703 Mar 26, 2025
5 checks passed
@dannys4 dannys4 deleted the an/d2 branch March 26, 2025 12:38
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