PDA

View Full Version : how to compile gui faster



prabhatjha
25th May 2015, 08:55
hey all, i made a gui in qt actuallty i am using lots of calculation like fft, invfft, hlbrt and so on .........
it take 9 second to plot but i want it must be plot in 1 second. plzzz help me how to do this.
thanks in advance

d_stranz
25th May 2015, 16:12
Let me see... my crystal ball tells me that you are doing too much calculation to create your "gui in qt" and you should either find a way to 1) simplify the calculation, 2) do the calculation in the background and not while painting the plot, 3) give the user some feedback that tells them the progress of the calculation, or 4) do something else.

Alternatively, you could get someone to make you a special clock where the second hand takes 9 seconds to move a one second interval.

ars
25th May 2015, 16:39
It's hard to give any advice when there is nearly no information on your problem available. So here are just some points that come into my mind:

Make sure to compile in release mode with suitable optimization settings
Identify your bottleneck: Is it the in the algorithms (fft, ...) or is it in result presentation (drawing, ...)
Can you simplify some of the sequential steps of your algorithms, or, in other words: is it possible to find a specialized algorithm for solving your task instead of just combining standard algorithms
As already mentioned: are there parts of your computations that can be run in parallel on different processor cores?
Are you using the best implementations (libraries) in your computational stuff? As an example, there are uncountable fft implementations around (free and commercial) but there's big difference in runtime
Have you done some complexity analysis of your problem and does your implementation follow the results of such analysis?
Are there any partial/preliminary results that you can save from one step in your computations to speed up the next steps, i.e. improve runtime by paying with memory?
...

wysota
25th May 2015, 22:43
Let me see... my crystal ball tells me that you are doing too much calculation to create your "gui in qt" and you should either find a way to 1) simplify the calculation, 2) do the calculation in the background and not while painting the plot, 3) give the user some feedback that tells them the progress of the calculation, or 4) do something else.

Alternatively, you could get someone to make you a special clock where the second hand takes 9 seconds to move a one second interval.

Or you can buy a faster computer :)

prabhatjha
27th May 2015, 14:53
Thanx a lot to everyone to giving suggession...
Actually right now i am mentioning what i am doing and whats will be the algo flow.
I am getting data from user on every second so i made a timer which time interval is 1 second.
in timer i am calling a function name simulation which will simulate all data from user and calculate fft, invfft, demon,welch,noise reduction,hosa and there are too many function which is calling in simulation function.but due to lots of function is calling in simulation it is taking 8-9 second for completion.so anyone can help me how i can do this all calculation that it will take 1 sec max for all calculation.

wysota
27th May 2015, 15:45
I opt for:


1) simplify the calculation

d_stranz
28th May 2015, 21:57
calculate fft, invfft, demon,welch,noise reduction,hosa and...

Is it absolutely required that you do this once a second, every second? If you can't simply the calculation, then you simply can't do it once a second if it takes 8 - 9 seconds total.

If the calculations are a pipeline (fft -> ifft -> demon -> ...) then the best you can do is to try to find multi-threaded versions of these computational steps. If the steps are not in a pipeline, then you could perform all of them in parallel using threads.

If you want to get into writing GPU / CUDA code, then this would probably be the fastest way to do it, either in series or in parallel. In my experience with CUDA code, you can speed up calculations by orders of magnitude by moving them off the CPU and into the GPU. The Nvidia CUDA web site has GPU-based FFT (https://developer.nvidia.com/cuFFT) code in addition to other numerical algorithms.

Finally, you can investigate the Intel Performance Primitives (https://software.intel.com/en-us/intel-ipp) library. I use this for FFT calculations.