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 QThread cannot speedup my program on Intel core 2 duo Q6700
Forum Updated to NodeBB v4.3 + New Features

Why QThread cannot speedup my program on Intel core 2 duo Q6700

Scheduled Pinned Locked Moved General and Desktop
12 Posts 6 Posters 6.4k Views 1 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.
  • P Offline
    P Offline
    PigiRoN
    wrote on 20 Aug 2010, 06:33 last edited by
    #3

    [quote author="Franzk" date="1282279430"]Please update your code with code tags (@) so it becomes readable.[/quote]

    Thanks for your remind. it's my first time starting a discussion.

    i tried it in another i7 920 computer currently. It works well and four threads made up 2.82x speedup. So i think it's Q6700's problem.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on 20 Aug 2010, 06:56 last edited by
      #4

      And what times are on Q6700? I can't believe that something that parallels ok at T9300 and i7 strangely breaks at Q6700.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        PigiRoN
        wrote on 20 Aug 2010, 07:11 last edited by
        #5

        [quote author="Denis Kormalev" date="1282287379"]And what times are on Q6700? I can't believe that something that parallels ok at T9300 and i7 strangely breaks at Q6700.[/quote]

        Serial code cost 23s, while parallel code cost 32s. I tried it many times.

        But when i increase p from 4 to 32 or 64 on Q6700, it will speedup 3.7x...

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on 20 Aug 2010, 07:21 last edited by
          #6

          How do you actually run the multithreaded code? Are you doing something stupid there that forces a serialization again?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mario
            wrote on 20 Aug 2010, 10:18 last edited by
            #7

            @PigiRoN: Little OT, but just out of curiosity...

            Would it be possible to use "QtConcurrent::mappedReduced":http://doc.qt.nokia.com/4.6/qtconcurrentmap.html#mappedReduced instead of almost all the code you have written?

            I think that the "QtConcurrent":http://doc.qt.nokia.com/4.6/threads-qtconcurrent.html module contains a lot of goodies for doing this kind of stuff.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tobias.hunger
              wrote on 20 Aug 2010, 13:51 last edited by
              #8

              mario: Yeap, that is what I would have tried, too. Let's try to help with the current solution though.

              1 Reply Last reply
              0
              • I Offline
                I Offline
                ixSci
                wrote on 20 Aug 2010, 17:22 last edited by
                #9

                There are can be really many causes for this behaviour. It should be investigated by yourself which one you have encountered. It can be bind with the cache related issues(missing, races etc.) and it can be just an overhead of using thread. The best answer you can get from the thorough profiling of your code.

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  DenisKormalev
                  wrote on 20 Aug 2010, 17:49 last edited by
                  #10

                  [quote author="ixSci" date="1282324950"]There are can be really many causes for this behaviour. It should be investigated by yourself which one you have encountered. It can be bind with the cache related issues(missing, races etc.) and it can be just an overhead of using thread. The best answer you can get from the thorough profiling of your code.
                  [/quote]

                  More strange that it works ok for author at another multicore processors. So source architecture problems and possible race conditions are hardly the reason.

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    ixSci
                    wrote on 21 Aug 2010, 04:51 last edited by
                    #11

                    Different processors have different cache size and that may be a problem source.

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      PigiRoN
                      wrote on 24 Aug 2010, 07:24 last edited by
                      #12

                      [quote author="Denis Kormalev" date="1282326556"][quote author="ixSci" date="1282324950"]There are can be really many causes for this behaviour. It should be investigated by yourself which one you have encountered. It can be bind with the cache related issues(missing, races etc.) and it can be just an overhead of using thread. The best answer you can get from the thorough profiling of your code.
                      [/quote]

                      More strange that it works ok for author at another multicore processors. So source architecture problems and possible race conditions are hardly the reason. [/quote]

                      As long as increasing number of threads to 64, it will speedup 1.98x on dual core cpu or 3.79x on quad core cpu stably.

                      1 Reply Last reply
                      0

                      12/12

                      24 Aug 2010, 07:24

                      • Login

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