Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Parallel vs Threading

Parallel vs Threading

Scheduled Pinned Locked Moved C#
beta-testingvisual-studioai-testingtestingperformance
7 Posts 2 Posters 0 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.
  • G Offline
    G Offline
    Ger Hayden
    wrote on last edited by
    #1

    I'm doing some automated testing where I read a datarow from a spreadsheet then pull in a set of steps from and apply the data to a web page. There is no dependency between the data row, each using its own browser instance to simulate an individual user. From the little I've learned there are performance differences between parallel and thread based executions. At the moment I intend to go thread based - but may I have some feedback from community based in your experience.

    Ger

    L 1 Reply Last reply
    0
    • G Ger Hayden

      I'm doing some automated testing where I read a datarow from a spreadsheet then pull in a set of steps from and apply the data to a web page. There is no dependency between the data row, each using its own browser instance to simulate an individual user. From the little I've learned there are performance differences between parallel and thread based executions. At the moment I intend to go thread based - but may I have some feedback from community based in your experience.

      Ger

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      There is no easy answer. Depending on the type processing required and the hardware resources available (i.e. CPU "cores"), parallelizing will perform better or it may not. Building and tearing down tasks incurs overhead; overhead not incurred in "non-parallel" operations. If the load can be spread around, and all tasks can run independently then parallelizing can work for you; otherwise it may not. You need to benchmark your options and keep in mind your final configuration; don't optimize prematurely.

      G 1 Reply Last reply
      0
      • L Lost User

        There is no easy answer. Depending on the type processing required and the hardware resources available (i.e. CPU "cores"), parallelizing will perform better or it may not. Building and tearing down tasks incurs overhead; overhead not incurred in "non-parallel" operations. If the load can be spread around, and all tasks can run independently then parallelizing can work for you; otherwise it may not. You need to benchmark your options and keep in mind your final configuration; don't optimize prematurely.

        G Offline
        G Offline
        Ger Hayden
        wrote on last edited by
        #3

        112 pages take 50 mins to complete sequentially

        Ger

        L 1 Reply Last reply
        0
        • G Ger Hayden

          112 pages take 50 mins to complete sequentially

          Ger

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          And? I once got a payroll job that ran for 24 hours down to 20 minutes by presorting one of the input files. No multitasking.

          G 1 Reply Last reply
          0
          • L Lost User

            And? I once got a payroll job that ran for 24 hours down to 20 minutes by presorting one of the input files. No multitasking.

            G Offline
            G Offline
            Ger Hayden
            wrote on last edited by
            #5

            And ... I expect some experimentation is in order. I've never operated beyond a single thread in a commercial environment before - I've never had the need, just like your experience a decent sort or index has always been sufficient. If it works well, it should give me a simulated multi user situation. Each discrete task opens a web page, browses to a URL (served by localhost) fills two text boxes hits two radios, clicks a button then kills the page.

            Ger

            L 1 Reply Last reply
            0
            • G Ger Hayden

              And ... I expect some experimentation is in order. I've never operated beyond a single thread in a commercial environment before - I've never had the need, just like your experience a decent sort or index has always been sufficient. If it works well, it should give me a simulated multi user situation. Each discrete task opens a web page, browses to a URL (served by localhost) fills two text boxes hits two radios, clicks a button then kills the page.

              Ger

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I see; thank you. The problem (IMO) you are faced with is that the response from each web page (i.e. site) can be different; based on the path to that site. I would therefore say your app is "IO / Input bound". In this case, parallel processing should help since other tasks can run while others wait for a web response (using asynchronous callbacks). (Out of curiosity, I would put "stop watch" code around my internet accesses and time them for the various sites).

              G 1 Reply Last reply
              0
              • L Lost User

                I see; thank you. The problem (IMO) you are faced with is that the response from each web page (i.e. site) can be different; based on the path to that site. I would therefore say your app is "IO / Input bound". In this case, parallel processing should help since other tasks can run while others wait for a web response (using asynchronous callbacks). (Out of curiosity, I would put "stop watch" code around my internet accesses and time them for the various sites).

                G Offline
                G Offline
                Ger Hayden
                wrote on last edited by
                #7

                For the specific test threading reduced the elapsed time from 50 to 25 mins, and significantly improved CPU utilisation.

                Ger

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups