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 / C++ / MFC
  4. win 32 C++ code performance optimization

win 32 C++ code performance optimization

Scheduled Pinned Locked Moved C / C++ / MFC
performancec++algorithmsquestioncode-review
4 Posts 4 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.
  • S Offline
    S Offline
    samchepe
    wrote on last edited by
    #1

    There is an application which downloads and installs a few applications on user machine after checking his machine for already installed things. We need to parallelize this code in order to optimize its performance. We are thinking of running one thread for downloads - one after another, and another thread for running the installs - as soon as a download is complete this thread will take over the installation. However are there more tricks to parallelize more things - say parallelize 2 downloads? Any other tricks to minimize CPU usage / optimize on memory usgae and reduce total time required? Thanks in advance SSC

    X D 2 Replies Last reply
    0
    • S samchepe

      There is an application which downloads and installs a few applications on user machine after checking his machine for already installed things. We need to parallelize this code in order to optimize its performance. We are thinking of running one thread for downloads - one after another, and another thread for running the installs - as soon as a download is complete this thread will take over the installation. However are there more tricks to parallelize more things - say parallelize 2 downloads? Any other tricks to minimize CPU usage / optimize on memory usgae and reduce total time required? Thanks in advance SSC

      X Offline
      X Offline
      XtremDev
      wrote on last edited by
      #2

      If you parallelize 2 downloads you will divide the download bandwitdh by 2 ??? no ? in consequence the download of the both files will take the same time than if you download one by one. However I think that installing during downloading is a good idea.

      1 Reply Last reply
      0
      • S samchepe

        There is an application which downloads and installs a few applications on user machine after checking his machine for already installed things. We need to parallelize this code in order to optimize its performance. We are thinking of running one thread for downloads - one after another, and another thread for running the installs - as soon as a download is complete this thread will take over the installation. However are there more tricks to parallelize more things - say parallelize 2 downloads? Any other tricks to minimize CPU usage / optimize on memory usgae and reduce total time required? Thanks in advance SSC

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        samchepe wrote:

        We need to parallelize this code in order to optimize its performance.

        There's nothing wrong with splitting work between threads, but unless you have a multi-processor machine, creating additional threads does not necessarily result in a performance gain. Most of the time it has the opposite effect (due to all of the context switches).


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        Z 1 Reply Last reply
        0
        • D David Crow

          samchepe wrote:

          We need to parallelize this code in order to optimize its performance.

          There's nothing wrong with splitting work between threads, but unless you have a multi-processor machine, creating additional threads does not necessarily result in a performance gain. Most of the time it has the opposite effect (due to all of the context switches).


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          Z Offline
          Z Offline
          zoid
          wrote on last edited by
          #4

          In this case it will lead to an optimization as each thread will spend most of its time waiting on IO.

          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