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. GUI freezes caused by high stream rates
QtWS25 Last Chance

GUI freezes caused by high stream rates

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 173 Views
  • 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.
  • M Offline
    M Offline
    mtjsc00
    wrote on last edited by
    #1

    Hello,

    Firstly, sorry in advance for my poor english as it is not my first language.

    So, I have to create a powerful app that plots industrial robot positions in real-time. I wrote a demo app that runs a UDP server on a worker thread which fetches the data from the robot and emits a signal containing it. I use a QCustomPlot to plot the data.

    My problem is that generally the data stream rate we use is at 250 Hz but it can't be handled by the GUI which freezes if the user interacts. Surprisingly, my demo can go up to 100Hz before being saturated.

    Also I can't downsample the data fetched and I can't change the stream rate. Do you have an idea of how I can prevent GUI freezes at these stream rates ? (alternatives to QCustomPlot, Qt, software optimizations, ...).

    Thank you !

    jeremy_kJ 1 Reply Last reply
    0
    • M mtjsc00

      Hello,

      Firstly, sorry in advance for my poor english as it is not my first language.

      So, I have to create a powerful app that plots industrial robot positions in real-time. I wrote a demo app that runs a UDP server on a worker thread which fetches the data from the robot and emits a signal containing it. I use a QCustomPlot to plot the data.

      My problem is that generally the data stream rate we use is at 250 Hz but it can't be handled by the GUI which freezes if the user interacts. Surprisingly, my demo can go up to 100Hz before being saturated.

      Also I can't downsample the data fetched and I can't change the stream rate. Do you have an idea of how I can prevent GUI freezes at these stream rates ? (alternatives to QCustomPlot, Qt, software optimizations, ...).

      Thank you !

      jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by jeremy_k
      #2

      @mtjsc00 said in GUI freezes caused by high stream rates:

      Hello,

      Firstly, sorry in advance for my poor english as it is not my first language.

      So, I have to create a powerful app that plots industrial robot positions in real-time. I wrote a demo app that runs a UDP server on a worker thread which fetches the data from the robot and emits a signal containing it. I use a QCustomPlot to plot the data.

      My problem is that generally the data stream rate we use is at 250 Hz but it can't be handled by the GUI which freezes if the user interacts. Surprisingly, my demo can go up to 100Hz before being saturated.

      Also I can't downsample the data fetched and I can't change the stream rate. Do you have an idea of how I can prevent GUI freezes at these stream rates ? (alternatives to QCustomPlot, Qt, software optimizations, ...).

      Thank you !

      Hi,

      Your use of English is fine!

      First off, have you profiled to see where the time is spent? Optimizing outside of hotspots isn't going to yield much improvement.

      An extra thread emitting a signal per sample might make the situation worse, as each emission will result in a metacall event. Unless significant time is spent processing each datagram (verified through profiling), try performing all of the work in the GUI thread. If too much time is indeed spent per datagram, try to complete as much computation as possible before crossing a thread boundary.

      Is there a target frame rate for the application? While this may sound like the explicitly disallowed downsampling, computation on samples that will never be shown is wasted time. If the UI is expected to update at 30 or 60 Hz, try batching at that interval. Queue the updates, and use a timer to dispatch them at the desired rate. Prune samples that are superseded by later samples in the same update batch.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      2
      • M mtjsc00 has marked this topic as solved on

      • Login

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