Results 1 to 9 of 9

Thread: C++ speed is not consistant and C# is. Why?

  1. #1

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037

    C++ speed is not consistant and C# is. Why?

    This is actually, in my opinion, a very weird happening. I have a c++ program that stretches an image in the entire window and then draws that same image at normal size whereever the mouse moves.

    It works great and fast if I have another large program open like VS. But if I just have dev and the program running the drawing is slower than C# is.

    But C# remains the same.

    Is there something that .net does that my little c++ app does not that could cause that wierdness?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    This is really weird. Mind sending me the two apps? Along with whatever test method you use, if it's not recognizable by the human eye.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    This is just a theory...

    If VS is open already, then could C# be running fast because the runtimes are already loaded and optimised for the best spot in memory? But VS is a heavy bit of software, could that be slowing down a C++ app?

    Just what occurs to me of the top of my head.
    I don't live here any more.

  4. #4

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037
    Thanks CornedBee. It is actually the same two app I was working on for that Drawing speed test.
    Here is the link: CLICK

    I know that it will be a pain downloading from there in the 3 chunks of the file I have split up. So, if you want I can send them to your e-mail. Pm me for that.

    It is VS for C# not C++ and when it is open, or when alot of other program instances are running the C++ app actually speed up. It does not slow down unless it is one of the few apps running. Seems backwards to me too.

    I tested this on 2 different comps. It may or may not keep the pattern I said above all the time though. It is inconsistant.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Noticed it too. This is absurd. Just absurd.

    Oh, and the unoptimized, DrawImage version of the C# app was faster for me than the BitBlt...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037
    That is a good thing to know; that drawImage is faster. I'd like to use it in C++ but I'm not sure if I can with dev.

  7. #7
    Junior Member
    Join Date
    Apr 2003
    Location
    New Zealand
    Posts
    19
    Just a guess but are you running a dual-processor system?

    The app would be running on the same thread as all other apps if you had few open, but if you had lots it might be forced to have hte thread processed by your secondary processor, which at the time might not have as much load as the primary...

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I at least are not.

    Even if I were, the behavior you described would speak of very poor OS management of the CPUs.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037
    I am not running dues processors on either computer either.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width