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. C# vs. Unmanaged C++

C# vs. Unmanaged C++

Scheduled Pinned Locked Moved C#
csharpc++dotnetvisual-studiocom
6 Posts 3 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
    gt4924f
    wrote on last edited by
    #1

    Does anyone have any resources or benchmarks on execution speed of C# and unmanaged C++ code? I'm primarily interested in intensive mathmatical algorithms. My gut feeling tells me that unmanaged code should be faster because it lacks the intermediate languages and compilers that are involved with C# (or the .NET framework in general). However, I did find this interesting benchmark that I find a little hard to believe. But who knows? http://www.devhood.com/tutorials/tutorial\_details.aspx?tutorial\_id=203&printer=t

    N 1 Reply Last reply
    0
    • G gt4924f

      Does anyone have any resources or benchmarks on execution speed of C# and unmanaged C++ code? I'm primarily interested in intensive mathmatical algorithms. My gut feeling tells me that unmanaged code should be faster because it lacks the intermediate languages and compilers that are involved with C# (or the .NET framework in general). However, I did find this interesting benchmark that I find a little hard to believe. But who knows? http://www.devhood.com/tutorials/tutorial\_details.aspx?tutorial\_id=203&printer=t

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      It's not a fair comparison to compare C# with unmanaged C++. Or do you actually mean managed C++? Nish

      Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice

      G 1 Reply Last reply
      0
      • N Nish Nishant

        It's not a fair comparison to compare C# with unmanaged C++. Or do you actually mean managed C++? Nish

        Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice

        G Offline
        G Offline
        gt4924f
        wrote on last edited by
        #3

        I'm not sure I understand what you mean by not being "fair" to compare the two. I'm interested in knowing if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). Or am I going to take a perfomance hit by switching to .NET and managed code. I mean, I know it's not "fair" to compare a Honda Civic EX to a Ferrari 360 Modena, but I sure know which one is faster. That's all I want to know.

        N N 2 Replies Last reply
        0
        • G gt4924f

          I'm not sure I understand what you mean by not being "fair" to compare the two. I'm interested in knowing if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). Or am I going to take a perfomance hit by switching to .NET and managed code. I mean, I know it's not "fair" to compare a Honda Civic EX to a Ferrari 360 Modena, but I sure know which one is faster. That's all I want to know.

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          Well then here goes :- Unmanaged code will always run faster than managed code. Thus unmanaged C++ will be faster than C# or any other .NET language including managed C++. Among the managed languages, managed C++ produces slightly faster code cause the MC++ compiler has certain extra optimizations [I do not know the details, but I've heard Chris M rave about this several times] Nish

          Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice

          1 Reply Last reply
          0
          • G gt4924f

            I'm not sure I understand what you mean by not being "fair" to compare the two. I'm interested in knowing if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). Or am I going to take a perfomance hit by switching to .NET and managed code. I mean, I know it's not "fair" to compare a Honda Civic EX to a Ferrari 360 Modena, but I sure know which one is faster. That's all I want to know.

            N Offline
            N Offline
            Nemanja Trifunovic
            wrote on last edited by
            #5

            gt4924f wrote: if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). No! C# was designed to be "easy to use", not to be fast. If you want to do some math calculations, pick either C++ (maybe with Blitz library) or Fortran. Everything else is too slow IMHO. I vote pro drink :beer:

            N 1 Reply Last reply
            0
            • N Nemanja Trifunovic

              gt4924f wrote: if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). No! C# was designed to be "easy to use", not to be fast. If you want to do some math calculations, pick either C++ (maybe with Blitz library) or Fortran. Everything else is too slow IMHO. I vote pro drink :beer:

              N Offline
              N Offline
              Nish Nishant
              wrote on last edited by
              #6

              Nemanja Trifunovic wrote: C# was designed to be "easy to use", not to be fast Exactly. In fact most of .NET seems to be like that :-) Nish

              Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice

              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