TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why is FFTW written in OCaml and what makes it so fast?

172 pointsby Cieplakover 6 years ago

8 comments

jacobolusover 6 years ago
According to DJB, what makes it so fast is deceptive benchmarks, <a href="https:&#x2F;&#x2F;cr.yp.to&#x2F;djbfft&#x2F;bench-notes.html" rel="nofollow">https:&#x2F;&#x2F;cr.yp.to&#x2F;djbfft&#x2F;bench-notes.html</a><p>Maybe something has changed in the 2 decades since that? Their benchmark page seems to have not really changed in at least a decade.<p>I would guess that folks making use of GPUs could probably get quite a speedup on this type of numerical workload in 2018.
评论 #18234650 未加载
sambeover 6 years ago
I don&#x27;t know anything about FFTW, but the question&#x2F;answer seem misleading:<p>GitHub language details of the <i>non-generated</i> sources say 75% C: <a href="https:&#x2F;&#x2F;github.com&#x2F;FFTW&#x2F;fftw3" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;FFTW&#x2F;fftw3</a><p>FFTW author comment linked from Quora answer contradicts said answer (~2&#x2F;3 C): <a href="https:&#x2F;&#x2F;groups.google.com&#x2F;d&#x2F;msg&#x2F;fa.caml&#x2F;B5kFMTl67MU&#x2F;9c8swiOE0M8J" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;d&#x2F;msg&#x2F;fa.caml&#x2F;B5kFMTl67MU&#x2F;9c8swiOE...</a><p>Am I missing something here? Double generation?
评论 #18234255 未加载
评论 #18233998 未加载
评论 #18233988 未加载
scott_sover 6 years ago
Since the linked explanation assumes you know what it is and what it stands for: Fastest Fourier Transform in the West, <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;FFTW" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;FFTW</a>
gnufxover 6 years ago
FFTW certainly isn&#x27;t simply written on OCaml. Apart from higher-level C, at base it has the sort of low-level micro-architecture-specific kernels you&#x27;d expect (using C intrinsics rather than assembler in this case).<p>[There was useful advice in <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;3058546" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;3058546</a> for example, and doubtless more recently, concerning trolling.]
flatlineover 6 years ago
TIL that FFTW is not just another a C library, per se. Impressive, but it does explain a few things, as the C library is fairly cumbersome to use.
slivymover 6 years ago
The problem I&#x27;ve always had with FFTs is that it&#x27;s incredibly difficult to write an optimal FFT for X size, Y direction, Z variability (X=2^4-2^64, Y=FWD,REV,BIDIR, Z=2^4-2^(log2(X)))<p>Does the metaprogramming element of FFTW work well, or does it boil down to &quot;If X=2^4, Y=FWD, Z=X: build24FWDX()&quot;?
评论 #18235332 未加载
jancsikaover 6 years ago
&gt; run-time profiling to choose the fastest codelets (which is largely affected by the target architecture).<p>What&#x27;s the quick overview of how this run-time profiling works?<p>The value of such a system seems immense but I only have seen it mentioned with reference to fftw. Have there been efforts to generalize that process to realtime DSP programming?
评论 #18234336 未加载
评论 #18233765 未加载
a-dubover 6 years ago
good ol&#x27; genfft
评论 #18233727 未加载