Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFMl + Qt program slowing down/freezing  (Read 2267 times)

0 Members and 1 Guest are viewing this topic.

Nyssiom

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFMl + Qt program slowing down/freezing
« 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 :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: SFMl + Qt program slowing down/freezing
« Reply #1 on: July 24, 2015, 10:42:05 am »
Profile it and find out where the time is "lost".
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nyssiom

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFMl + Qt program slowing down/freezing
« Reply #2 on: July 24, 2015, 12:34:08 pm »
Ok, so from what I can read, I need a third party software to profile ?


Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFMl + Qt program slowing down/freezing
« Reply #3 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: SFMl + Qt program slowing down/freezing
« Reply #4 on: July 24, 2015, 06:13:10 pm »
I recommend Intel's VTune.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFMl + Qt program slowing down/freezing
« Reply #5 on: July 24, 2015, 06:16:23 pm »
I recommend Intel's VTune.
Why? I'm not being argumentative; I genuinely want to know.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Nyssiom

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFMl + Qt program slowing down/freezing
« Reply #6 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
« Last Edit: July 24, 2015, 07:04:50 pm by Nyssiom »

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: SFMl + Qt program slowing down/freezing
« Reply #7 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.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFMl + Qt program slowing down/freezing
« Reply #8 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  :)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*