SFML community forums

Help => General => Topic started by: Nyssiom on July 22, 2015, 03:32:47 pm

Title: SFMl + Qt program slowing down/freezing
Post by: Nyssiom on July 22, 2015, 03:32:47 pm
Hello,

I am currently doing a basic program supposed to draw a plot with data received from a serial communication, sending a number every n milliseconds.

I'm using two classes:
- a Qt widget ( receives the data, and send it to the second class)  (FenPrincipale.h )
- the plot class, wich draws the plot (stores X and Y numbers in 2 float vectors and then add a position to a     sf::VertexArray).    (FenPlot.h)

//FenPlot Constructor
        int size = 10000;
        m_curve = sf::VertexArray(sf::LinesStrip, size);
        m_currentX = 0;
        m_vectorX.resize(size);
        m_vectorY.resize(size);

//addY() function
void FenPlot::addY(int y)
{

    m_vectorX[m_currentX] = (float)m_currentX;
    m_vectorY[m_currentX] = (float)y;
    m_curve[m_currentX].position = sf::Vector2f(m_vectorX[m_currentX], m_vectorY[m_currentX]);
    m_currentX++;
}
 



The issue I am having is that , after few values added, the program slows down and evetually freeze.
I can't figure out the reason to that progressive loss of performance.

Qt 5.4.0, SFML 2.3, Win 8.1, QtCreator

Thank you :)
Title: AW: SFMl + Qt program slowing down/freezing
Post by: eXpl0it3r on July 24, 2015, 10:42:05 am
Profile it and find out where the time is "lost".
Title: Re: SFMl + Qt program slowing down/freezing
Post by: Nyssiom on July 24, 2015, 12:34:08 pm
Ok, so from what I can read, I need a third party software to profile ?

Title: Re: SFMl + Qt program slowing down/freezing
Post by: Hapax on July 24, 2015, 05:35:07 pm
I need a third party software to profile ?
Unless your IDE provides a profiler, you will need a separate one to be able to profile, yes.
You could try AMD's profiler: CodeXL (http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/).
Title: Re: SFMl + Qt program slowing down/freezing
Post by: Jesper Juhl on July 24, 2015, 06:13:10 pm
I recommend Intel's VTune.
Title: Re: SFMl + Qt program slowing down/freezing
Post by: Hapax on July 24, 2015, 06:16:23 pm
I recommend Intel's VTune.
Why? I'm not being argumentative; I genuinely want to know.
Title: Re: SFMl + Qt program slowing down/freezing
Post by: Nyssiom on July 24, 2015, 06:38:09 pm
Ok I'll take a look at Vtune  ::)
I'm open to anything else :)

I'm trying to setup my project for vtune, but do I have to specify in my project ?

Quote
Unless your IDE provides a profiler, you will need a separate one to be able to profile, yes.
You could try AMD's profiler: CodeXL.

I tried codexl, but it keeps reading .dll and doen't finish
Title: Re: SFMl + Qt program slowing down/freezing
Post by: Jesper Juhl on July 25, 2015, 04:13:13 pm
I recommend Intel's VTune.
Why? I'm not being argumentative; I genuinely want to know.
1. I have some experience with it and have found it to be genuinely useful.
2. It runs on both Linux and Windows.
3. Besides just doing basic function call counts and timings it can show lots of details on things like cache misses, pipeline stalls, other performance counters etc.
4. It is fairly easy to use.
Title: Re: SFMl + Qt program slowing down/freezing
Post by: Hapax on July 26, 2015, 01:43:40 am
I tried codexl, but it keeps reading .dll and doen't finish
No worries. If it doesn't suit you, don't use it  :)

[good reasons]
Sounds good. Will look into it, thanks  :)