You can find all informations here
You can find all informations here
how can I know the function that caused the increase of the microprocessor.
i used profiler, i saw that my program spend the most time in the function "drawLines( QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to ) const", and there is an increase of microprocessor until 20 %. Please how i can resolve this problem.
Don't draw as muchAnd seriously trace back to your code which is effectively responsible for calling drawLines and see if you can optimize there. And by the way, looking at percentage of time your CPU spends in the process makes no sense. If system is idle and your process is doing any computing, the CPU will spend 100% of time there which isn't anything bad. You should monitor percepted latency or absolute time (or number of cycles) it takes for your process to do its job.
Thank you for your answer,
Firstly i'm sur that darwlines is responsible for increase microprocessor, because whene i comment it, there is no increase. secondly i can't optimise fucntion which call darwlines it's a function of qwt.
I don't understand what do you want to say by number of cycle?
Read my post again, especially the sentence starting with "Trace back to your code".
I want to say that if some job makes the CPU execute 1000 instructions to complete and with a different algorithm it takes only 100 instructions then the second algorithm is more optimal than the first one.I don't understand what do you want to say by number of cycle?
OK, so finally you have given us the first real clue about what is actually going on. Your performance problem is not in reading datagram packets from your socket, it is what you are doing with the data after you read them.secondly i can't optimise fucntion which call darwlines it's a function of qwt.
Apparently you are plotting this data using Qwt. When you run into a performance problem with Qwt, it almost always means you are trying to plot too much or plot it too frequently. Your processor gets completely tied up just drawing things.
In that case, don't do it whatever way you are trying to plot data. If you are causing Qwt to replot with every new point, then don't do that. Each time you change the data Qwt is plotting, it will redraw all of the data. Plot the data in larger chunks, or set up a QTimer that causes Qwt to update the plot only once very second or every 1/2 second. In almost every case, you don't need real time updates, but you can get by with frequent updates instead.
Bookmarks