Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Program created with Qt running slower than expected

Program created with Qt running slower than expected

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 539 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Linhares
    wrote on last edited by
    #1

    I have a program made with Qt 5.15 that reads physiological data from a sensor and displays data on the screen in real time. The device sends data at a rate of 250 samples per second. The GUI contains some graphs and other objects -- not too many of them.
    The program starts running at a reasonable pace, but it gets progressivelly slower during the runtime as the streaming data gets in.

    The objects have circular buffers of a reasonable size.
    There's no excessive usage of CPU or memory.
    Running on Windows 10 64bit.
    The program is built in 32bit architecture (limitation imposed by the device's library).

    Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

    Christian EhrlicherC Chris KawaC 2 Replies Last reply
    0
    • L Linhares

      I have a program made with Qt 5.15 that reads physiological data from a sensor and displays data on the screen in real time. The device sends data at a rate of 250 samples per second. The GUI contains some graphs and other objects -- not too many of them.
      The program starts running at a reasonable pace, but it gets progressivelly slower during the runtime as the streaming data gets in.

      The objects have circular buffers of a reasonable size.
      There's no excessive usage of CPU or memory.
      Running on Windows 10 64bit.
      The program is built in 32bit architecture (limitation imposed by the device's library).

      Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Linhares said in Program created with Qt running slower than expected:

      Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

      Don't show all 250 samples per second but only 1 - the rest can't be visually seen by the user anyway.
      If there is no CPU load problem then maybe it's a memory leak problem - check if you don't leak a lot of memory.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      L 1 Reply Last reply
      0
      • L Linhares

        I have a program made with Qt 5.15 that reads physiological data from a sensor and displays data on the screen in real time. The device sends data at a rate of 250 samples per second. The GUI contains some graphs and other objects -- not too many of them.
        The program starts running at a reasonable pace, but it gets progressivelly slower during the runtime as the streaming data gets in.

        The objects have circular buffers of a reasonable size.
        There's no excessive usage of CPU or memory.
        Running on Windows 10 64bit.
        The program is built in 32bit architecture (limitation imposed by the device's library).

        Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

        Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Linhares said:

        The device sends data at a rate of 250 samples per second

        Are you updating the screen after each new sample? If yes then does your device actually have 250Hz display?
        If not then you're probably flooding your event queue with updates your hardware can't physically handle that fast. In that case buffer the data and handle it in bursts at a rate of your actual display.

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @Linhares said in Program created with Qt running slower than expected:

          Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

          Don't show all 250 samples per second but only 1 - the rest can't be visually seen by the user anyway.
          If there is no CPU load problem then maybe it's a memory leak problem - check if you don't leak a lot of memory.

          L Offline
          L Offline
          Linhares
          wrote on last edited by
          #4

          @Christian-Ehrlicher said in Program created with Qt running slower than expected:

          @Linhares said in Program created with Qt running slower than expected:

          Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

          Don't show all 250 samples per second but only 1 - the rest can't be visually seen by the user anyway.
          If there is no CPU load problem then maybe it's a memory leak problem - check if you don't leak a lot of memory.

          I need to draw graphs that show most of the data (EEG traces, for instance). In graphs like these, I'm usually using 1 sample out 4 to reduce the amount of data to be displayed.

          @Chris-Kawa said in Program created with Qt running slower than expected:

          @Linhares said:

          The device sends data at a rate of 250 samples per second

          Are you updating the screen after each new sample? If yes then does your device actually have 250Hz display?
          If not then you're probably flooding your event queue with updates your hardware can't physically handle that fast. In that case buffer the data and handle it in bursts at a rate of your actual display.

          No, I'm not updating after each new sample. I'm using buffers and each object updates once it has got a certain number of new samples (the exact number varies from one object to other -- I think the fastest one updates every 30 milliseconds).

          One thing I've just thought: each object updates independently of the other objects. Could this be a problem?
          Also, how fast should the changes be so that the hardware can handle them?

          Chris KawaC 1 Reply Last reply
          0
          • L Linhares

            @Christian-Ehrlicher said in Program created with Qt running slower than expected:

            @Linhares said in Program created with Qt running slower than expected:

            Any thoughts on what I could try to improve the speed and make it run more smoothly? Thank you.

            Don't show all 250 samples per second but only 1 - the rest can't be visually seen by the user anyway.
            If there is no CPU load problem then maybe it's a memory leak problem - check if you don't leak a lot of memory.

            I need to draw graphs that show most of the data (EEG traces, for instance). In graphs like these, I'm usually using 1 sample out 4 to reduce the amount of data to be displayed.

            @Chris-Kawa said in Program created with Qt running slower than expected:

            @Linhares said:

            The device sends data at a rate of 250 samples per second

            Are you updating the screen after each new sample? If yes then does your device actually have 250Hz display?
            If not then you're probably flooding your event queue with updates your hardware can't physically handle that fast. In that case buffer the data and handle it in bursts at a rate of your actual display.

            No, I'm not updating after each new sample. I'm using buffers and each object updates once it has got a certain number of new samples (the exact number varies from one object to other -- I think the fastest one updates every 30 milliseconds).

            One thing I've just thought: each object updates independently of the other objects. Could this be a problem?
            Also, how fast should the changes be so that the hardware can handle them?

            Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            One thing I've just thought: each object updates independently of the other objects. Could this be a problem?

            Only you can check :)

            Also, how fast should the changes be so that the hardware can handle them?

            You can update a circular buffer 250 times a second with no problem. Unless that update is somehow super heavy that's a drop in a bucket. As for displaying I can't tell you, I don't know your hardware ;) Usually lower to mid range consumer grade monitors update at 60Hz, which means every 16.666ms.

            each object updates once it has got a certain number of new samples

            I would say change that to a steady interval and update all objects with significant amount of new data at once. As a bonus you'll wake up CPU less this way, saving some power (energy prices are so high these days... ).

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved