JuliaApproximation / JuliaApproximation/FastTransforms.jl

Loading FastTransforms.jl can make FFTs via FFTW.jl 100x slower due to threading conflicts

Open
#267 0 comments 2 reactions 2 assignees View on GitHub

@dlfivefifty is already working on this.

Since Jul 10, 2026.

  • #270 by @copilot-swe-agent — open
Dominant language
Julia
Stars
281
Forks
27
PR merge metrics
No merged PRs in 30d

Description

While this is not a self-contained example, I would like to summarize an issue I had so that others may find it (and my workaround) when they search for it.

Loading FastTransforms.jl (import FastTransforms or using FastTransforms or loading a package depending on FastTransforms.jl) made some FFTs (of small real vectors with 256 to 4096 entries) via FFTW.jl roughly 100x slower on my system (when running Julia with one thread). Debugging this via the profiling tools showed that a huge amount of time was spent in __psynch_cvwait and __psynch_cvsignal. The reason appears to be

https://github.com/JuliaApproximation/FastTransforms.jl/blob/14a311816ffb58131ee09d7d6bf3cc50793dfc6a/src/libfasttransforms.jl#L15-L20

Reversing these settings by executing

FastTransforms.ft_set_num_threads(1)
ccall((:ft_fftw_init_threads, FastTransforms.libfasttransforms), Cint, ())
FastTransforms.ft_fftw_plan_with_nthreads(1)

after loading FastTransforms fixed the performance issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.