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. DevPartner and WaitForSingleObject

DevPartner and WaitForSingleObject

Scheduled Pinned Locked Moved C#
performancetestingdebuggingbeta-testingquestion
3 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.
  • P Offline
    P Offline
    PaleyX
    wrote on last edited by
    #1

    I am doing some code profiling on my project to try and identify any speed bottlenecks - I am using DevPartner community edition from Compuware - when I run the tests my project spends about 90% in WaitForSingleObject, Sleep and SleepEx - why would it do that? The program isn't multithreaded and the main part of the program I am testing has no user interraction - it's basically some IO and a lot of bit shifting. TIA

    D 1 Reply Last reply
    0
    • P PaleyX

      I am doing some code profiling on my project to try and identify any speed bottlenecks - I am using DevPartner community edition from Compuware - when I run the tests my project spends about 90% in WaitForSingleObject, Sleep and SleepEx - why would it do that? The program isn't multithreaded and the main part of the program I am testing has no user interraction - it's basically some IO and a lot of bit shifting. TIA

      D Offline
      D Offline
      Daniel Turini
      wrote on last edited by
      #2

      PaleyX wrote: it's basically some IO You have to wait for the I/O finish. Often this is done by the CLR using WaitForSingleObject, because some I/O classes only implement asynchronous interfaces (Begin*/End*) - the synchronous versions of these methods simply call the Begin/End pair. What you're seeing is that your program is spending 90% of the time blocked by I/O. Maybe multithreading would help you a bit. Yes, even I am blogging now!

      P 1 Reply Last reply
      0
      • D Daniel Turini

        PaleyX wrote: it's basically some IO You have to wait for the I/O finish. Often this is done by the CLR using WaitForSingleObject, because some I/O classes only implement asynchronous interfaces (Begin*/End*) - the synchronous versions of these methods simply call the Begin/End pair. What you're seeing is that your program is spending 90% of the time blocked by I/O. Maybe multithreading would help you a bit. Yes, even I am blogging now!

        P Offline
        P Offline
        PaleyX
        wrote on last edited by
        #3

        Thanks for that. It isn't really a problem as the program is fast enough - analyse 1 billion records per second anybody? I was just curious why it was spending so much time sleeping and waiting. Rugby League: The Greatest Game Of All.

        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