Home > database >  Would multithreading help a Fast Fourier Transform?
Would multithreading help a Fast Fourier Transform?

Time:10-16

I have to get performance out of an application by multi-threading it for a project. So far I attempted to make a Task that would be created to handle a 2048 segment of audio, and that task would be created for each segment to run independently. However, this configuration means making several thousands of tasks which causes more performance problems then worth, not to mention I couldn't find a way to convert the existing recursive FFT into an iterative one to maintain that 1:1 on segments to tasks. Would there be any benefit to continuing to attempt this? or should I look more to optimizing the application else where.

CodePudding user response:

Look at your core usage on your computer when running the transformation as a serial process. Have you maxed out your CPU? If not, then the parallel library can help you access more computing power.

I would recommend reading up on tutorials and theory on the parallel library (assembly) in C#.

CodePudding user response:

I ended up going with Klamsi's solution (commented on the question). After doing more cleaning and bug fixing, I settled on a data structure that would be Queued that includes the data's respective index in an output array to avoid to results being in the wrong order. The result after this (with output locking): Debug Sequential: 2.1ms Debug Multithread: 2.6ms Release Sequential: ~940ms Release Multithread: ~650ms

release multithread can hit around 500-600 without locking.

  • Related