Can you write code directly in CIL ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Olcott

    #76
    Re: Can you write code directly in CIL ???


    "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in message
    news:%23w4YrBAD GHA.1312@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > Peter,
    > | That would take more time that I can afford to spend right now.
    > PMFJI: I would think the amount of time you have spent battling your cause
    > in *this* thread and the other thread, you could have translated the code
    > itself to C# & timed it. I further suspect you could have come close to
    > converting the code with ILDASM and hand tweaked the IL itself.
    >
    > | I already did
    > | that with native code 6.0 and 7.0. Even this is too slow. Because
    > benchmarks
    > | indicate that C# can be 450% slower on nested loops (my code is mostly
    > nested
    > | loops), I wanted to look into solving this problem in advance.
    > I would "solve" this problem by converting the code, do some profiling &
    > timing on the converted code, and going from there! I would convert to C#
    > first, if C# proved to be too slow, I would then consider a unsafe C#,
    > followed by Managed C++ class library, as a last resort I would consider a
    > hand tweaked IL class library. My concern with hand tweaked IL would be when
    > the JIT was updated with better optimization algorithms which conflicted
    > with my hand tweaking, the 32bit JIT behaved differently then the 64bit JIT,
    > or the JIT behaved differently based on processor...
    >
    > Remember to time the C# code outside of the VS IDE and use a Release build.
    > As the C# compiler doesn't optimize Debug builds & JIT compiler won't
    > optimize any code run under the IDE.
    >
    > | This is just the
    > | feasibility study stage.
    > It would seem to me that if these 100 lines are the "critical" lines to your
    > process, then taking the time to convert them would be paramount for
    > determining the feasibility of the project.[/color]

    The project has already been determined to be feasible. This stage is assessing
    whether or not converting it to C# .NET is feasible.
    [color=blue]
    >
    > IMHO I would not use some generic C# benchmark to decide if the project is a
    > go or no go. I would prototype (translate) the critical code & time that.[/color]

    There is a learning curve involved in this that might hurt my chances of
    ultimate success. This is the point in time where I decide to proceed down the
    C# .NET path or remain on the native code C++ path. I can't afford to spend the
    time learning C# and .NET, and then converting even this part of the project to
    later find out that C# and .NET were not the way to go. At this stage I am
    determining which of these two paths to take.
    [color=blue]
    >
    > | I might be forced to digress to unmanaged code.
    > I would only digress to unmanaged code, once C#, unsafe C#, Managed C++ &
    > hand tweaked IL all proved (*proved*) to have performance issues.
    >
    >
    > --
    > Hope this helps
    > Jay [MVP - Outlook]
    > .NET Application Architect, Enthusiast, & Evangelist
    > T.S. Bradley - http://www.tsbradley.net
    >
    >
    > "Peter Olcott" <olcott@att.net > wrote in message
    > news:NSDsf.3809 2$QW2.25345@duk eread08...
    > |
    > | "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
    > | news:%23mzM%23V $CGHA.2644@TK2M SFTNGP09.phx.gb l...
    > | >
    > <<snip>>
    > | > Again this is all based on what you read on the internet (NG's etc) not
    > on
    > | > personal findings, while my findings are based on real test runs.
    > | > Please do us and yourself a favor, translate your 100 line C++ (or
    > whatever)
    > | > code to C# and run it and compare the time it takes with a similar run
    > of your
    > | > C code.
    > |
    > | That would take more time that I can afford to spend right now. I already
    > did
    > | that with native code 6.0 and 7.0. Even this is too slow. Because
    > benchmarks
    > | indicate that C# can be 450% slower on nested loops (my code is mostly
    > nested
    > | loops), I wanted to look into solving this problem in advance. This is
    > just the
    > | feasibility study stage. I might be forced to digress to unmanaged code.
    > |
    >
    >[/color]


    Comment

    • Peter Olcott

      #77
      Re: Can you write code directly in CIL ???


      "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
      news:eh98zaADGH A.1288@TK2MSFTN GP09.phx.gbl...[color=blue][color=green]
      > >
      >> That would take more time that I can afford to spend right now. I already did
      >> that with native code 6.0 and 7.0. Even this is too slow. Because benchmarks
      >> indicate that C# can be 450% slower on nested loops (my code is mostly nested
      >> loops), I wanted to look into solving this problem in advance. This is just
      >> the feasibility study stage. I might be forced to digress to unmanaged code.
      >>[color=darkred]
      >>>
      >>> Willy.[/color][/color]
      >
      > This is hilarious, you are making a fool of yourself really (or should I call
      > you a troll?), Translating 100 lines of C code to C# takes 5 minutes of your
      > time, hand optimizing the IL another 10 minutes, this is far less than the
      > time you wasted in this thread.[/color]

      First I have to learn C# and .NET.
      [color=blue]
      >
      > I said in other replies and in the other thread you started that the 450%
      > benchmarks is clueless and broken, read my reply in the relevant thread for[/color]

      Yet you never bothered to say what is clueless and broken about it, thus it is
      merely an unsupported assertion.
      [color=blue]
      > more details.
      >
      > Willy.
      >
      >[/color]


      Comment

      • Peter Olcott

        #78
        Re: Can you write code directly in CIL ???


        "Pohihihi" <noemail@hotmai l.com> wrote in message
        news:uT$ANoADGH A.2320@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Peter,
        >
        > Now it is very clear that you are not looking for any solution as you have
        > argument for every suggestion, and more over your argument is not solution
        > bound but ego bound. Seems like using this thread you are feeding your ego. If
        > ego is not the case and if you are so smart why even bother coming on this
        > newsgroup and replying every single post. If you are worried about your work
        > so much and millions of $$$ then you should have dropped this long time back
        > and try to find other ways own your own which we now all think you are not
        > worried about.
        >
        > Seems like you are having a ego ride here showing off your 16000 hours of work
        > and going behind every solution. If you think non is working in your case they
        > move on dude. Believe me no one will even care what happened to you after
        > that.
        >[/color]
        The purpose of this thread was to determine the feasibility of converting my
        project to .NET. That answer has not yet been sufficiently derived. My project
        is feasible if I limit the options to native code. Whether or not .NET is
        capable of native code performance should be a topic of great interest. This
        issue has not been fully resolved. I was shocked and disappointed to see that
        even the native code performance of MSVC++ was degraded as it was updated from
        6.0 to 7.0. This is a problem that I didn't think could occur. There is another
        screwy quirk that 2002 refuses to compile a C++ project converted from 6.0 if
        that project is located on a network. It ends with internal compiler error
        C1001. MS tech support said that this is an error that they won't bother to fix,
        or provide support for.

        [color=blue]
        >
        >
        >
        > "Peter Olcott" <olcott@att.net > wrote in message
        > news:wpAsf.3805 4$QW2.18933@duk eread08...[color=green]
        >>
        >> "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
        >> news:OFjwIX9CGH A.3976@TK2MSFTN GP10.phx.gbl...[color=darkred]
        >>>
        >>> "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> wrote in
        >>> message news:u3jMQ$8CGH A.740@TK2MSFTNG P12.phx.gbl...
        >>>> ROFL, that's hilarious.
        >>>>
        >>>> --
        >>>
        >>>
        >>> That's right, guess it's time to let this thread die,
        >>>
        >>> Willy.
        >>>
        >>>[/color]
        >>
        >>
        >> http://www.tommti-systems.de/go.html...enchmarks.html
        >> What about addressing this issue?
        >>[/color]
        >
        >[/color]


        Comment

        • mablejune@otismukinfus.com

          #79
          Re: Can you write code directly in CIL ???

          On Mon, 26 Dec 2005 17:58:39 -0600, "Peter Olcott" <olcott@att.net >
          wrote:
          [color=blue]
          >Cab you write code directly in the Common Intermediate language? I need to
          >optimize a critical real-time function.
          >[/color]
          Without a doubt, this is the longest thread I have ever seen. It
          looks like a lightening bolt in the reader when the replies are
          exposed ;o)

          Comment

          • mablejune@otismukinfus.com

            #80
            Re: Can you write code directly in CIL ???

            On Mon, 26 Dec 2005 19:50:35 -0600, "Peter Olcott" <olcott@att.net >
            wrote:

            {snip}[color=blue]
            >I have
            >16,000 hours of development time in my current project.[/color]

            Oh, Peter....

            Since you didn't say "our" project I assume you spent 2000 8 hour
            man-days (5.479452054794 520547945205479 4521 years) without taking a
            day off on your project.

            Would you mind telling us how many lines of code are in your 16,000
            hour project? I'm sure one, such as yourself, who pays great
            attention to detail will know the exact count.

            I'd like to calculate how long it took you to write that 100 line
            function.

            I think you're full of BS, troll...

            mable


            Comment

            • Peter Olcott

              #81
              Re: Can you write code directly in CIL ???


              <mablejune@otis mukinfus.com> wrote in message
              news:nfm6r192oq f5n8sbmsuauopco 0jd4vmo0i@4ax.c om...[color=blue]
              > On Mon, 26 Dec 2005 19:50:35 -0600, "Peter Olcott" <olcott@att.net >
              > wrote:
              >
              > {snip}[color=green]
              >>I have
              >>16,000 hours of development time in my current project.[/color]
              >
              > Oh, Peter....
              >
              > Since you didn't say "our" project I assume you spent 2000 8 hour
              > man-days (5.479452054794 520547945205479 4521 years) without taking a
              > day off on your project.
              >
              > Would you mind telling us how many lines of code are in your 16,000
              > hour project? I'm sure one, such as yourself, who pays great
              > attention to detail will know the exact count.
              >
              > I'd like to calculate how long it took you to write that 100 line
              > function.
              >
              > I think you're full of BS, troll...[/color]

              Time will tell.
              [color=blue]
              >
              > mable
              >
              >[/color]


              Comment

              • Peter Olcott

                #82
                Re: Can you write code directly in CIL ???


                <mablejune@otis mukinfus.com> wrote in message
                news:nfm6r192oq f5n8sbmsuauopco 0jd4vmo0i@4ax.c om...[color=blue]
                > On Mon, 26 Dec 2005 19:50:35 -0600, "Peter Olcott" <olcott@att.net >
                > wrote:
                >
                > {snip}[color=green]
                >>I have
                >>16,000 hours of development time in my current project.[/color]
                >
                > Oh, Peter....
                >
                > Since you didn't say "our" project I assume you spent 2000 8 hour
                > man-days (5.479452054794 520547945205479 4521 years) without taking a
                > day off on your project.
                >
                > Would you mind telling us how many lines of code are in your 16,000
                > hour project? I'm sure one, such as yourself, who pays great
                > attention to detail will know the exact count.
                >
                > I'd like to calculate how long it took you to write that 100 line
                > function.
                >
                > I think you're full of BS, troll...[/color]

                Credibility like belief and disbelief are fallacious conceptions, they each
                cause conclusions to be drawn based on necessarily insufficient information.
                [color=blue]
                >
                > mable
                >
                >[/color]


                Comment

                • Peter Olcott

                  #83
                  Re: Can you write code directly in CIL ???


                  "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in message
                  news:%23w4YrBAD GHA.1312@TK2MSF TNGP09.phx.gbl. ..[color=blue]
                  > Peter,
                  > | That would take more time that I can afford to spend right now.
                  > PMFJI: I would think the amount of time you have spent battling your cause
                  > in *this* thread and the other thread, you could have translated the code
                  > itself to C# & timed it. I further suspect you could have come close to
                  > converting the code with ILDASM and hand tweaked the IL itself.
                  >
                  > | I already did
                  > | that with native code 6.0 and 7.0. Even this is too slow. Because
                  > benchmarks
                  > | indicate that C# can be 450% slower on nested loops (my code is mostly
                  > nested
                  > | loops), I wanted to look into solving this problem in advance.
                  > I would "solve" this problem by converting the code, do some profiling &
                  > timing on the converted code, and going from there! I would convert to C#
                  > first, if C# proved to be too slow, I would then consider a unsafe C#,
                  > followed by Managed C++ class library, as a last resort I would consider a
                  > hand tweaked IL class library. My concern with hand tweaked IL would be when
                  > the JIT was updated with better optimization algorithms which conflicted
                  > with my hand tweaking, the 32bit JIT behaved differently then the 64bit JIT,
                  > or the JIT behaved differently based on processor...
                  >
                  > Remember to time the C# code outside of the VS IDE and use a Release build.
                  > As the C# compiler doesn't optimize Debug builds & JIT compiler won't
                  > optimize any code run under the IDE.
                  >
                  > | This is just the
                  > | feasibility study stage.
                  > It would seem to me that if these 100 lines are the "critical" lines to your
                  > process, then taking the time to convert them would be paramount for
                  > determining the feasibility of the project.
                  >
                  > IMHO I would not use some generic C# benchmark to decide if the project is a
                  > go or no go. I would prototype (translate) the critical code & time that.
                  >
                  > | I might be forced to digress to unmanaged code.
                  > I would only digress to unmanaged code, once C#, unsafe C#, Managed C++ &
                  > hand tweaked IL all proved (*proved*) to have performance issues.[/color]

                  Of course I would do it this way, yet I would not even proceed along the
                  learning curve path of .NET / C# if I did not at least have this last resort as
                  an option. There is great disagreement here whether or not this is an option.
                  What it seems to be is an option that few here are aware of.

                  [color=blue]
                  >
                  >
                  > --
                  > Hope this helps
                  > Jay [MVP - Outlook]
                  > .NET Application Architect, Enthusiast, & Evangelist
                  > T.S. Bradley - http://www.tsbradley.net
                  >
                  >
                  > "Peter Olcott" <olcott@att.net > wrote in message
                  > news:NSDsf.3809 2$QW2.25345@duk eread08...
                  > |
                  > | "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
                  > | news:%23mzM%23V $CGHA.2644@TK2M SFTNGP09.phx.gb l...
                  > | >
                  > <<snip>>
                  > | > Again this is all based on what you read on the internet (NG's etc) not
                  > on
                  > | > personal findings, while my findings are based on real test runs.
                  > | > Please do us and yourself a favor, translate your 100 line C++ (or
                  > whatever)
                  > | > code to C# and run it and compare the time it takes with a similar run
                  > of your
                  > | > C code.
                  > |
                  > | That would take more time that I can afford to spend right now. I already
                  > did
                  > | that with native code 6.0 and 7.0. Even this is too slow. Because
                  > benchmarks
                  > | indicate that C# can be 450% slower on nested loops (my code is mostly
                  > nested
                  > | loops), I wanted to look into solving this problem in advance. This is
                  > just the
                  > | feasibility study stage. I might be forced to digress to unmanaged code.
                  > |
                  >
                  >[/color]


                  Comment

                  • Peter Olcott

                    #84
                    Re: Can you write code directly in CIL ???


                    "Abubakar" <abubakarm@gmai l.com> wrote in message
                    news:eGGVda3CGH A.4016@TK2MSFTN GP11.phx.gbl...[color=blue][color=green]
                    >> I have to screen out the good advice from the advice that does not apply[/color]
                    > to my[color=green]
                    >> needs. With 16,000 hours of development in the current project, and the[/color]
                    > speed of[color=green]
                    >> a single 100 line function making or breaking the success of this project,[/color]
                    > many[color=green]
                    >> of the typical rules would not apply. One poster said that hand tweaked[/color]
                    > CIL[color=green]
                    >> doubled the speed, thus confirming my estimations.[/color]
                    >
                    > I want to advise that you first study the framework details. You are wanting
                    > to write the IL yourself which would be better than the C# compiler
                    > generated output, and you dont yet know about verified code, details of GC,[/color]


                    This was written by microsoft research about verified code, apparently you must
                    be talking about something else. This will not be fully implemented for at least
                    twenty years.
                    [color=blue]
                    > etc. I think you would yet have to go through the complete clr instruction
                    > set in order to pick the best instructions to best optimise the code. By now
                    > you must have got an idea that in .net world (as opposed to c++) its going
                    > to be extremely difficult to find people who occasionally hand code *.il
                    > files to acheive better performance.
                    >
                    > Ab.
                    >
                    > "Peter Olcott" <olcott@att.net > wrote in message
                    > news:QNosf.3802 0$QW2.8997@duke read08...[color=green]
                    >>[/color]
                    >
                    >[/color]


                    Comment

                    • Peter Olcott

                      #85
                      Re: Can you write code directly in CIL ???


                      "Abubakar" <abubakarm@gmai l.com> wrote in message
                      news:eGGVda3CGH A.4016@TK2MSFTN GP11.phx.gbl...[color=blue][color=green]
                      >> I have to screen out the good advice from the advice that does not apply[/color]
                      > to my[color=green]
                      >> needs. With 16,000 hours of development in the current project, and the[/color]
                      > speed of[color=green]
                      >> a single 100 line function making or breaking the success of this project,[/color]
                      > many[color=green]
                      >> of the typical rules would not apply. One poster said that hand tweaked[/color]
                      > CIL[color=green]
                      >> doubled the speed, thus confirming my estimations.[/color]
                      >
                      > I want to advise that you first study the framework details. You are wanting
                      > to write the IL yourself which would be better than the C# compiler
                      > generated output, and you dont yet know about verified code, details of GC,[/color]

                      Google and Google groups doesn't know about it either. I wonder what that means?
                      [color=blue]
                      > etc. I think you would yet have to go through the complete clr instruction
                      > set in order to pick the best instructions to best optimise the code. By now
                      > you must have got an idea that in .net world (as opposed to c++) its going
                      > to be extremely difficult to find people who occasionally hand code *.il
                      > files to acheive better performance.
                      >
                      > Ab.
                      >
                      > "Peter Olcott" <olcott@att.net > wrote in message
                      > news:QNosf.3802 0$QW2.8997@duke read08...[color=green]
                      >>[/color]
                      >
                      >[/color]


                      Comment

                      • Jay B. Harlow [MVP - Outlook]

                        #86
                        Re: Can you write code directly in CIL ???

                        Peter,
                        | The project has already been determined to be feasible. This stage is
                        assessing
                        | whether or not converting it to C# .NET is feasible.
                        You misunderstand!

                        What I stated in the message, and you seem to have missed:

                        It would seem to me that if these 100 lines are the "critical" lines to your
                        process, then taking the time to convert them to C# would be paramount for
                        determining the feasibility of using C# for the project.

                        In other words I would build a C# prototype to determine if C# was going to
                        work or not! Likewise with managed C++ or IL.

                        | C# .NET path or remain on the native code C++ path. I can't afford to
                        spend the
                        | time learning C# and .NET, and then converting even this part of the
                        project to
                        | later find out that C# and .NET were not the way to go. At this stage I am
                        | determining which of these two paths to take.

                        You can use my web site below to contact me if you would like to hire my
                        services on converting the 100 lines...

                        --
                        Hope this helps
                        Jay [MVP - Outlook]
                        ..NET Application Architect, Enthusiast, & Evangelist
                        T.S. Bradley - http://www.tsbradley.net


                        "Peter Olcott" <olcott@att.net > wrote in message
                        news:QUFsf.3810 9$QW2.10843@duk eread08...
                        |
                        | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in
                        message
                        | news:%23w4YrBAD GHA.1312@TK2MSF TNGP09.phx.gbl. ..
                        | > Peter,
                        | > | That would take more time that I can afford to spend right now.
                        | > PMFJI: I would think the amount of time you have spent battling your
                        cause
                        | > in *this* thread and the other thread, you could have translated the
                        code
                        | > itself to C# & timed it. I further suspect you could have come close to
                        | > converting the code with ILDASM and hand tweaked the IL itself.
                        | >
                        | > | I already did
                        | > | that with native code 6.0 and 7.0. Even this is too slow. Because
                        | > benchmarks
                        | > | indicate that C# can be 450% slower on nested loops (my code is mostly
                        | > nested
                        | > | loops), I wanted to look into solving this problem in advance.
                        | > I would "solve" this problem by converting the code, do some profiling &
                        | > timing on the converted code, and going from there! I would convert to
                        C#
                        | > first, if C# proved to be too slow, I would then consider a unsafe C#,
                        | > followed by Managed C++ class library, as a last resort I would consider
                        a
                        | > hand tweaked IL class library. My concern with hand tweaked IL would be
                        when
                        | > the JIT was updated with better optimization algorithms which conflicted
                        | > with my hand tweaking, the 32bit JIT behaved differently then the 64bit
                        JIT,
                        | > or the JIT behaved differently based on processor...
                        | >
                        | > Remember to time the C# code outside of the VS IDE and use a Release
                        build.
                        | > As the C# compiler doesn't optimize Debug builds & JIT compiler won't
                        | > optimize any code run under the IDE.
                        | >
                        | > | This is just the
                        | > | feasibility study stage.
                        | > It would seem to me that if these 100 lines are the "critical" lines to
                        your
                        | > process, then taking the time to convert them would be paramount for
                        | > determining the feasibility of the project.
                        |
                        | The project has already been determined to be feasible. This stage is
                        assessing
                        | whether or not converting it to C# .NET is feasible.
                        |
                        | >
                        | > IMHO I would not use some generic C# benchmark to decide if the project
                        is a
                        | > go or no go. I would prototype (translate) the critical code & time
                        that.
                        |
                        | There is a learning curve involved in this that might hurt my chances of
                        | ultimate success. This is the point in time where I decide to proceed down
                        the
                        | C# .NET path or remain on the native code C++ path. I can't afford to
                        spend the
                        | time learning C# and .NET, and then converting even this part of the
                        project to
                        | later find out that C# and .NET were not the way to go. At this stage I am
                        | determining which of these two paths to take.
                        |
                        | >
                        | > | I might be forced to digress to unmanaged code.
                        | > I would only digress to unmanaged code, once C#, unsafe C#, Managed C++
                        &
                        | > hand tweaked IL all proved (*proved*) to have performance issues.
                        | >
                        | >
                        | > --
                        | > Hope this helps
                        | > Jay [MVP - Outlook]
                        | > .NET Application Architect, Enthusiast, & Evangelist
                        | > T.S. Bradley - http://www.tsbradley.net
                        | >
                        | >
                        | > "Peter Olcott" <olcott@att.net > wrote in message
                        | > news:NSDsf.3809 2$QW2.25345@duk eread08...
                        | > |
                        | > | "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
                        | > | news:%23mzM%23V $CGHA.2644@TK2M SFTNGP09.phx.gb l...
                        | > | >
                        | > <<snip>>
                        | > | > Again this is all based on what you read on the internet (NG's etc)
                        not
                        | > on
                        | > | > personal findings, while my findings are based on real test runs.
                        | > | > Please do us and yourself a favor, translate your 100 line C++ (or
                        | > whatever)
                        | > | > code to C# and run it and compare the time it takes with a similar
                        run
                        | > of your
                        | > | > C code.
                        | > |
                        | > | That would take more time that I can afford to spend right now. I
                        already
                        | > did
                        | > | that with native code 6.0 and 7.0. Even this is too slow. Because
                        | > benchmarks
                        | > | indicate that C# can be 450% slower on nested loops (my code is mostly
                        | > nested
                        | > | loops), I wanted to look into solving this problem in advance. This is
                        | > just the
                        | > | feasibility study stage. I might be forced to digress to unmanaged
                        code.
                        | > |
                        | >
                        | >
                        |
                        |


                        Comment

                        • Peter Olcott

                          #87
                          Re: Can you write code directly in CIL ???


                          "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in message
                          news:%23aW$mCDE GHA.2648@TK2MSF TNGP11.phx.gbl. ..[color=blue]
                          > Peter,
                          > | The project has already been determined to be feasible. This stage is
                          > assessing
                          > | whether or not converting it to C# .NET is feasible.
                          > You misunderstand!
                          >
                          > What I stated in the message, and you seem to have missed:
                          >
                          > It would seem to me that if these 100 lines are the "critical" lines to your
                          > process, then taking the time to convert them to C# would be paramount for
                          > determining the feasibility of using C# for the project.[/color]

                          It looks like C# will not be feasible, but Managed C++ might be feasible.
                          Gain technical skills through documentation and training, earn certifications and connect with the community

                          Microsoft has focused their attention on providing optimization to managed C++
                          because this was the quickest way to provide the best optimization.

                          Now that I have a copy of Visual Studio 2005, with its purported much better
                          optimizations, I could make this sort of test. My purpose here was to see which
                          learning curve path I would need to proceed with. .NET or COM. I can't afford
                          the time to proceed down both these paths. If I proceed down both these paths
                          and find that the current path is infeasible, I am out of time and can't
                          complete the project. For this reason I needed to know if it was feasible to
                          write code directly in CIL, as a backup plan just in case the compiler
                          optimizations are not good enough. If this is true, then I can take the time to
                          learn .NET so that I can convert this 100-line function to .NET, otherwise I
                          must find some other way to determine which of these two paths to take in
                          advance. I guess that another scenario could be a .NET component wrapper with
                          unmanaged code at its core. There would only need to be one transition to the
                          unmanaged code, and one transition back form the unmanaged code. Since .NET has
                          such a simpler component model than COM, this approach might also prove to work.
                          The latest version of Visual Studio has a managed version of the STL. This would
                          further reduce my learning curve.
                          [color=blue]
                          >
                          > In other words I would build a C# prototype to determine if C# was going to
                          > work or not! Likewise with managed C++ or IL.
                          >
                          > | C# .NET path or remain on the native code C++ path. I can't afford to
                          > spend the
                          > | time learning C# and .NET, and then converting even this part of the
                          > project to
                          > | later find out that C# and .NET were not the way to go. At this stage I am
                          > | determining which of these two paths to take.
                          >
                          > You can use my web site below to contact me if you would like to hire my
                          > services on converting the 100 lines...
                          >
                          > --
                          > Hope this helps
                          > Jay [MVP - Outlook]
                          > .NET Application Architect, Enthusiast, & Evangelist
                          > T.S. Bradley - http://www.tsbradley.net
                          >
                          >
                          > "Peter Olcott" <olcott@att.net > wrote in message
                          > news:QUFsf.3810 9$QW2.10843@duk eread08...
                          > |
                          > | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in
                          > message
                          > | news:%23w4YrBAD GHA.1312@TK2MSF TNGP09.phx.gbl. ..
                          > | > Peter,
                          > | > | That would take more time that I can afford to spend right now.
                          > | > PMFJI: I would think the amount of time you have spent battling your
                          > cause
                          > | > in *this* thread and the other thread, you could have translated the
                          > code
                          > | > itself to C# & timed it. I further suspect you could have come close to
                          > | > converting the code with ILDASM and hand tweaked the IL itself.
                          > | >
                          > | > | I already did
                          > | > | that with native code 6.0 and 7.0. Even this is too slow. Because
                          > | > benchmarks
                          > | > | indicate that C# can be 450% slower on nested loops (my code is mostly
                          > | > nested
                          > | > | loops), I wanted to look into solving this problem in advance.
                          > | > I would "solve" this problem by converting the code, do some profiling &
                          > | > timing on the converted code, and going from there! I would convert to
                          > C#
                          > | > first, if C# proved to be too slow, I would then consider a unsafe C#,
                          > | > followed by Managed C++ class library, as a last resort I would consider
                          > a
                          > | > hand tweaked IL class library. My concern with hand tweaked IL would be
                          > when
                          > | > the JIT was updated with better optimization algorithms which conflicted
                          > | > with my hand tweaking, the 32bit JIT behaved differently then the 64bit
                          > JIT,
                          > | > or the JIT behaved differently based on processor...
                          > | >
                          > | > Remember to time the C# code outside of the VS IDE and use a Release
                          > build.
                          > | > As the C# compiler doesn't optimize Debug builds & JIT compiler won't
                          > | > optimize any code run under the IDE.
                          > | >
                          > | > | This is just the
                          > | > | feasibility study stage.
                          > | > It would seem to me that if these 100 lines are the "critical" lines to
                          > your
                          > | > process, then taking the time to convert them would be paramount for
                          > | > determining the feasibility of the project.
                          > |
                          > | The project has already been determined to be feasible. This stage is
                          > assessing
                          > | whether or not converting it to C# .NET is feasible.
                          > |
                          > | >
                          > | > IMHO I would not use some generic C# benchmark to decide if the project
                          > is a
                          > | > go or no go. I would prototype (translate) the critical code & time
                          > that.
                          > |
                          > | There is a learning curve involved in this that might hurt my chances of
                          > | ultimate success. This is the point in time where I decide to proceed down
                          > the
                          > | C# .NET path or remain on the native code C++ path. I can't afford to
                          > spend the
                          > | time learning C# and .NET, and then converting even this part of the
                          > project to
                          > | later find out that C# and .NET were not the way to go. At this stage I am
                          > | determining which of these two paths to take.
                          > |
                          > | >
                          > | > | I might be forced to digress to unmanaged code.
                          > | > I would only digress to unmanaged code, once C#, unsafe C#, Managed C++
                          > &
                          > | > hand tweaked IL all proved (*proved*) to have performance issues.
                          > | >
                          > | >
                          > | > --
                          > | > Hope this helps
                          > | > Jay [MVP - Outlook]
                          > | > .NET Application Architect, Enthusiast, & Evangelist
                          > | > T.S. Bradley - http://www.tsbradley.net
                          > | >
                          > | >
                          > | > "Peter Olcott" <olcott@att.net > wrote in message
                          > | > news:NSDsf.3809 2$QW2.25345@duk eread08...
                          > | > |
                          > | > | "Willy Denoyette [MVP]" <willy.denoyett e@telenet.be> wrote in message
                          > | > | news:%23mzM%23V $CGHA.2644@TK2M SFTNGP09.phx.gb l...
                          > | > | >
                          > | > <<snip>>
                          > | > | > Again this is all based on what you read on the internet (NG's etc)
                          > not
                          > | > on
                          > | > | > personal findings, while my findings are based on real test runs.
                          > | > | > Please do us and yourself a favor, translate your 100 line C++ (or
                          > | > whatever)
                          > | > | > code to C# and run it and compare the time it takes with a similar
                          > run
                          > | > of your
                          > | > | > C code.
                          > | > |
                          > | > | That would take more time that I can afford to spend right now. I
                          > already
                          > | > did
                          > | > | that with native code 6.0 and 7.0. Even this is too slow. Because
                          > | > benchmarks
                          > | > | indicate that C# can be 450% slower on nested loops (my code is mostly
                          > | > nested
                          > | > | loops), I wanted to look into solving this problem in advance. This is
                          > | > just the
                          > | > | feasibility study stage. I might be forced to digress to unmanaged
                          > code.
                          > | > |
                          > | >
                          > | >
                          > |
                          > |
                          >
                          >[/color]


                          Comment

                          • Jay B. Harlow [MVP - Outlook]

                            #88
                            Re: Can you write code directly in CIL ???

                            Peter,
                            | It looks like C# will not be feasible, but Managed C++ might be feasible.
                            | http://msdn.microsoft.com/msdnmag/is...5/VisualC2005/
                            | Microsoft has focused their attention on providing optimization to managed
                            C++
                            | because this was the quickest way to provide the best optimization.
                            Just remember one of the strengths in .NET is that you can create solutions
                            (applications) that leverage multiple languages.

                            You could create the bulk of your application in C#. You could write the
                            time critical part in Managed C++, you could write the UI in VB.NET. They
                            all get compiled into .NET Assemblies (an EXE or DLL that contains IL code).
                            The JIT compiler doesn't really care what languages created the assemblies.


                            --
                            Hope this helps
                            Jay [MVP - Outlook]
                            ..NET Application Architect, Enthusiast, & Evangelist
                            T.S. Bradley - http://www.tsbradley.net


                            "Peter Olcott" <olcott@att.net > wrote in message
                            news:5ivuf.4024 1$QW2.12685@duk eread08...
                            |
                            | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in
                            message
                            | news:%23aW$mCDE GHA.2648@TK2MSF TNGP11.phx.gbl. ..
                            | > Peter,
                            | > | The project has already been determined to be feasible. This stage is
                            | > assessing
                            | > | whether or not converting it to C# .NET is feasible.
                            | > You misunderstand!
                            | >
                            | > What I stated in the message, and you seem to have missed:
                            | >
                            | > It would seem to me that if these 100 lines are the "critical" lines to
                            your
                            | > process, then taking the time to convert them to C# would be paramount
                            for
                            | > determining the feasibility of using C# for the project.
                            |
                            | It looks like C# will not be feasible, but Managed C++ might be feasible.
                            | http://msdn.microsoft.com/msdnmag/is...5/VisualC2005/
                            | Microsoft has focused their attention on providing optimization to managed
                            C++
                            | because this was the quickest way to provide the best optimization.
                            |
                            | Now that I have a copy of Visual Studio 2005, with its purported much
                            better
                            | optimizations, I could make this sort of test. My purpose here was to see
                            which
                            | learning curve path I would need to proceed with. .NET or COM. I can't
                            afford
                            | the time to proceed down both these paths. If I proceed down both these
                            paths
                            | and find that the current path is infeasible, I am out of time and can't
                            | complete the project. For this reason I needed to know if it was feasible
                            to
                            | write code directly in CIL, as a backup plan just in case the compiler
                            | optimizations are not good enough. If this is true, then I can take the
                            time to
                            | learn .NET so that I can convert this 100-line function to .NET, otherwise
                            I
                            | must find some other way to determine which of these two paths to take in
                            | advance. I guess that another scenario could be a .NET component wrapper
                            with
                            | unmanaged code at its core. There would only need to be one transition to
                            the
                            | unmanaged code, and one transition back form the unmanaged code. Since
                            ..NET has
                            | such a simpler component model than COM, this approach might also prove to
                            work.
                            | The latest version of Visual Studio has a managed version of the STL. This
                            would
                            | further reduce my learning curve.
                            |
                            | >
                            | > In other words I would build a C# prototype to determine if C# was going
                            to
                            | > work or not! Likewise with managed C++ or IL.
                            | >
                            | > | C# .NET path or remain on the native code C++ path. I can't afford to
                            | > spend the
                            | > | time learning C# and .NET, and then converting even this part of the
                            | > project to
                            | > | later find out that C# and .NET were not the way to go. At this stage
                            I am
                            | > | determining which of these two paths to take.
                            | >
                            | > You can use my web site below to contact me if you would like to hire my
                            | > services on converting the 100 lines...
                            | >
                            | > --
                            | > Hope this helps
                            | > Jay [MVP - Outlook]
                            | > .NET Application Architect, Enthusiast, & Evangelist
                            | > T.S. Bradley - http://www.tsbradley.net
                            | >
                            | >
                            <<snip>>


                            Comment

                            • Peter Olcott

                              #89
                              Re: Can you write code directly in CIL ???


                              "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in message
                              news:%23T8nI8HE GHA.3324@TK2MSF TNGP10.phx.gbl. ..[color=blue]
                              > Peter,
                              > | It looks like C# will not be feasible, but Managed C++ might be feasible.
                              > | http://msdn.microsoft.com/msdnmag/is...5/VisualC2005/
                              > | Microsoft has focused their attention on providing optimization to managed
                              > C++
                              > | because this was the quickest way to provide the best optimization.
                              > Just remember one of the strengths in .NET is that you can create solutions
                              > (applications) that leverage multiple languages.
                              >
                              > You could create the bulk of your application in C#. You could write the
                              > time critical part in Managed C++, you could write the UI in VB.NET. They
                              > all get compiled into .NET Assemblies (an EXE or DLL that contains IL code).
                              > The JIT compiler doesn't really care what languages created the assemblies.[/color]

                              I just hope that the 2005 compiler fulfills its optimization claims.
                              [color=blue]
                              >
                              >
                              > --
                              > Hope this helps
                              > Jay [MVP - Outlook]
                              > .NET Application Architect, Enthusiast, & Evangelist
                              > T.S. Bradley - http://www.tsbradley.net
                              >
                              >
                              > "Peter Olcott" <olcott@att.net > wrote in message
                              > news:5ivuf.4024 1$QW2.12685@duk eread08...
                              > |
                              > | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @tsbradley.net> wrote in
                              > message
                              > | news:%23aW$mCDE GHA.2648@TK2MSF TNGP11.phx.gbl. ..
                              > | > Peter,
                              > | > | The project has already been determined to be feasible. This stage is
                              > | > assessing
                              > | > | whether or not converting it to C# .NET is feasible.
                              > | > You misunderstand!
                              > | >
                              > | > What I stated in the message, and you seem to have missed:
                              > | >
                              > | > It would seem to me that if these 100 lines are the "critical" lines to
                              > your
                              > | > process, then taking the time to convert them to C# would be paramount
                              > for
                              > | > determining the feasibility of using C# for the project.
                              > |
                              > | It looks like C# will not be feasible, but Managed C++ might be feasible.
                              > | http://msdn.microsoft.com/msdnmag/is...5/VisualC2005/
                              > | Microsoft has focused their attention on providing optimization to managed
                              > C++
                              > | because this was the quickest way to provide the best optimization.
                              > |
                              > | Now that I have a copy of Visual Studio 2005, with its purported much
                              > better
                              > | optimizations, I could make this sort of test. My purpose here was to see
                              > which
                              > | learning curve path I would need to proceed with. .NET or COM. I can't
                              > afford
                              > | the time to proceed down both these paths. If I proceed down both these
                              > paths
                              > | and find that the current path is infeasible, I am out of time and can't
                              > | complete the project. For this reason I needed to know if it was feasible
                              > to
                              > | write code directly in CIL, as a backup plan just in case the compiler
                              > | optimizations are not good enough. If this is true, then I can take the
                              > time to
                              > | learn .NET so that I can convert this 100-line function to .NET, otherwise
                              > I
                              > | must find some other way to determine which of these two paths to take in
                              > | advance. I guess that another scenario could be a .NET component wrapper
                              > with
                              > | unmanaged code at its core. There would only need to be one transition to
                              > the
                              > | unmanaged code, and one transition back form the unmanaged code. Since
                              > .NET has
                              > | such a simpler component model than COM, this approach might also prove to
                              > work.
                              > | The latest version of Visual Studio has a managed version of the STL. This
                              > would
                              > | further reduce my learning curve.
                              > |
                              > | >
                              > | > In other words I would build a C# prototype to determine if C# was going
                              > to
                              > | > work or not! Likewise with managed C++ or IL.
                              > | >
                              > | > | C# .NET path or remain on the native code C++ path. I can't afford to
                              > | > spend the
                              > | > | time learning C# and .NET, and then converting even this part of the
                              > | > project to
                              > | > | later find out that C# and .NET were not the way to go. At this stage
                              > I am
                              > | > | determining which of these two paths to take.
                              > | >
                              > | > You can use my web site below to contact me if you would like to hire my
                              > | > services on converting the 100 lines...
                              > | >
                              > | > --
                              > | > Hope this helps
                              > | > Jay [MVP - Outlook]
                              > | > .NET Application Architect, Enthusiast, & Evangelist
                              > | > T.S. Bradley - http://www.tsbradley.net
                              > | >
                              > | >
                              > <<snip>>
                              >
                              >[/color]


                              Comment

                              Working...