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. Why is the signal and slot mechanism in Windows slower than Linux?

Why is the signal and slot mechanism in Windows slower than Linux?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 338 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
    M_A_A
    wrote on last edited by
    #1

    I wrote a program, which receives data via qtcpsocket and passes the data to another class using a signal to parse my own protocol. I first implemented this code on ubuntu and qt 5.14.2 and then compiled it on windows. In Linux, all received packets were processed in a stream by my parser without any problems, but in Windows, only one was processed for every 10 to 12 received packets, and the rest are delayed in the event queue. After some time, the RAM memory is filled from the accumulation of input signals to the queue.
    I also wrote the same program with Qwebsocket, which also worked without problems in Linux, but in Windows it caused a lot of delay in the processing, causing the tcp window to fill up.
    Please guide me.

    JonBJ 1 Reply Last reply
    0
    • M M_A_A

      I wrote a program, which receives data via qtcpsocket and passes the data to another class using a signal to parse my own protocol. I first implemented this code on ubuntu and qt 5.14.2 and then compiled it on windows. In Linux, all received packets were processed in a stream by my parser without any problems, but in Windows, only one was processed for every 10 to 12 received packets, and the rest are delayed in the event queue. After some time, the RAM memory is filled from the accumulation of input signals to the queue.
      I also wrote the same program with Qwebsocket, which also worked without problems in Linux, but in Windows it caused a lot of delay in the processing, causing the tcp window to fill up.
      Please guide me.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @M_A_A If your code overflows RAM it sounds as though it is incorrect, maybe it shows up more under Windows.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        M_A_A
        wrote on last edited by
        #3

        I added two counters to the program. One of the counters counts the number of received packets and the second counter counts the number of processed packets. In Linux, there is no difference between these two counters, but in Windows, the difference is 10 received packets to 1 processed packet.

        1 Reply Last reply
        0
        • J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          hard to tell without a working crystal ball, mine is currently in repair - accumulated some cracks recently.

          I'll try some standard questions/solutions:

          • Maybe your Windows is running in a VM on your linux machine with the lowest settings possible ?
          • Is one release and one a debug build ?

          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          2
          • M Offline
            M Offline
            M_A_A
            wrote on last edited by M_A_A
            #5

            The operating systems used are windows 10 and linux ubuntu 20.04 and neither is a vm. Two independent operating systems on two separate ssd hard drives.
            Both tests were done with the release version of the program.
            On Windows, it has been tested with both msvc2017 and mingw, with similar results.
            In addition, I got the same results on two other PCs and Windows was much slower than Linux.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Asperamanca
              wrote on last edited by
              #6

              Are you actually processing all packets currently in the event loop on the receiving side? Or are you only processing one, then yielding?
              The batching behavior and thread scheduling could be very different between windows and linux.
              Also, is your CPU busy or idle?
              Last but not least, have you tested with a newer Qt version, or checked for open issues in the Qt bug database?

              1 Reply Last reply
              0

              • Login

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