Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126795

Replacing old SIGNAL-SLOT syntax with new syntax to avoid numerous allocations

    XMLWordPrintable

Details

    Description

      This is a suggestion for replacing old SIGNAL-SLOT syntax with new syntax to avoid numerous allocations happen.

      When a customer was analyzing their program with a heap memory profiler, they found a lot of allocations done when doing Network communication to a none responding server.
      That was comming from QNetworkReplyHttpImplPrivate:postRequest and QHttpThreadDelegate::startRequest via QMetaObectPrivate::decodeMethodSignature. 
      This is because these functions still use the old SIGNAL-SLOT syntax. When changing them to the new syntax these numerous allocations no longer happen.

      That was observed by using heatrtack on Linux platform.
      The attached screenshots shows the result:

      • allocations_without_patch_1.png
      • allocations_without_patch_2.png

      An example application (HttpRequester) and the patches from the customer are also attached.
      "allocations_with_patch.png" shows the result observed after the patches applied.

      Attachments

        1. allocations_with_patch.png
          allocations_with_patch.png
          198 kB
        2. allocations_without_patch_1.png
          allocations_without_patch_1.png
          180 kB
        3. allocations_without_patch_2.png
          allocations_without_patch_2.png
          484 kB
        4. HttpRequester.zip
          1 kB
        5. patch.zip
          23 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            hitoshiito Hitoshi Ito
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes