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

Ouverte
#267 0 commentaires 2 réactions 2 personnes assignées Voir sur GitHub

@dlfivefifty y travaille déjà.

Depuis le 10/7/2026.

  • #270 par @copilot-swe-agent — ouverte

Évaluation

Cette issue n'a pas encore été évaluée.

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.

Langage dominant
Julia
Étoiles
284
Forks
28
Merge moyen
9 h 21 min
PR mergées (30 j)
2

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de JuliaApproximation/FastTransforms.jl

Toutes les issues de JuliaApproximation/FastTransforms.jl

Issues similaires

Plus d'issues Julia

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.