If not .Net then what?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Heathfield

    #76
    Re: If not .Net then what?

    "Miha Markic" <miha at rthand comsaid:
    >
    >Another objection is that it's slow. The first program I moved to .Net
    >ran around 60 times slower than native - way too slow to be useful.
    >
    It is not that slow.
    Denial? Interesting.
    It might be a bit slower or a bit faster, depending
    on what you are doing.
    A bit, yes. :-)
    But the magnitude of your problem clearly shows that you were doing
    something wrong.
    No, that's begging the question.

    --
    Richard Heathfield <http://www.cpax.org.uk >
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999

    Comment

    • Jon Skeet [C# MVP]

      #77
      Re: If not .Net then what?

      Richard Heathfield <rjh@see.sig.in validwrote:

      <snip>
      The race is next week. What should the team do? Sing the praises of the
      car, and say "this must be our fault for not knowing the car; let's forget
      the race, and work 24/7 on getting the car up to walking speed in time for
      the following race"? Or are they more likely to say "this looks like a
      complete lemon - let's stick with a car that can compete"?
      I don't think anyone's really criticising your decision to go with
      native C++ instead of .NET - it's the fact that you've taken your first
      experience of .NET (which sounds half-hearted - you got the result you
      wanted, i.e. the decision to stick with C++, and didn't put significant
      effort into understanding why the .NET version was slow) and
      extrapolated from there to your original claim that "it's slow".

      I suspect that if I wrote C++ trying to use .NET idioms, that could be
      slow as well - but I wouldn't make the assumption that that was the
      fault of C++.

      It's worth accepting that different platforms have different idioms,
      and that you shouldn't expect your first experiences in a "new"
      platform to compare well with experiences in a platform on which you
      have a lot of experience.

      Now, if you'd hired a .NET developer (not necessarily an expert - just
      someone who was genuinely familiar with the platform), profiled the
      app, *tried* to make it perform well, and still failed - *that* would
      have been good evidence that .NET was slow for your particular
      situation. (It still wouldn't have been good *general* evidence of
      course.)

      --
      Jon Skeet - <skeet@pobox.co m>
      http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
      World class .NET training in the UK: http://iterativetraining.co.uk

      Comment

      • Richard Heathfield

        #78
        Re: If not .Net then what?

        Jon Skeet [C# MVP] said:

        <snip>
        I don't think anyone's really criticising your decision to go with
        native C++ instead of .NET - it's the fact that you've taken your first
        experience of .NET (which sounds half-hearted - you got the result you
        wanted, i.e. the decision to stick with C++,
        Well, to be honest, I wanted C, but my colleague reasoned that C++ is
        pretty much like C except that it has more toys, and it would be easier
        for me to ignore toys I don't want than for her to do without toys she's
        used to. She had a point, of course, so we went C++ instead of C.
        and didn't put significant
        effort into understanding why the .NET version was slow) and
        extrapolated from there to your original claim that "it's slow".
        Life's too short to spend it doing exhaustive analysis of every single
        technology that comes along. Nevertheless, we spent several weeks on the
        ..Net thing, if memory serves me right. And we did use it to write a test
        harness, which we ended up using even though we didn't like it very much.
        I suspect that if I wrote C++ trying to use .NET idioms, that could be
        slow as well - but I wouldn't make the assumption that that was the
        fault of C++.
        Yes, it's a fair point. Nevertheless, it does seem that .Net struggles with
        recursive algorithms, which makes it kinda pointless for language
        processing applications.

        <snip>
        Now, if you'd hired a .NET developer (not necessarily an expert - just
        someone who was genuinely familiar with the platform), profiled the
        app, *tried* to make it perform well, and still failed - *that* would
        have been good evidence that .NET was slow for your particular
        situation. (It still wouldn't have been good *general* evidence of
        course.)
        It would have been a neat trick, actually, since the ink on the box was
        still wet - the only .Net people in the UK at the time were either beta
        testers or liars. :-)

        But we did give it the best shot we could without compromising the
        deadline.

        --
        Richard Heathfield <http://www.cpax.org.uk >
        Email: -http://www. +rjh@
        Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
        "Usenet is a strange place" - dmr 29 July 1999

        Comment

        • Miha Markic

          #79
          Re: If not .Net then what?

          Nevertheless, it does seem that .Net struggles with
          recursive algorithms, which makes it kinda pointless for language
          processing applications.
          It does seem to you....

          --
          Miha Markic [MVP C#, INETA Country Leader for Slovenia]
          RightHand .NET consulting & development www.rthand.com
          Blog: http://cs.rthand.com/blogs/blog_with_righthand/

          Comment

          • =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?=

            #80
            Re: If not .Net then what?

            Richard Heathfield wrote:
            Jon Skeet [C# MVP] said:
            >
            <snip>
            >
            >I don't think anyone's really criticising your decision to go with
            >native C++ instead of .NET - it's the fact that you've taken your first
            >experience of .NET (which sounds half-hearted - you got the result you
            >wanted, i.e. the decision to stick with C++,
            >
            Well, to be honest, I wanted C, but my colleague reasoned that C++ is
            pretty much like C except that it has more toys, and it would be easier
            for me to ignore toys I don't want than for her to do without toys she's
            used to. She had a point, of course, so we went C++ instead of C.
            >
            >and didn't put significant
            >effort into understanding why the .NET version was slow) and
            >extrapolated from there to your original claim that "it's slow".
            >
            Life's too short to spend it doing exhaustive analysis of every single
            technology that comes along. Nevertheless, we spent several weeks on the
            .Net thing, if memory serves me right. And we did use it to write a test
            harness, which we ended up using even though we didn't like it very much.
            >
            >I suspect that if I wrote C++ trying to use .NET idioms, that could be
            >slow as well - but I wouldn't make the assumption that that was the
            >fault of C++.
            >
            Yes, it's a fair point. Nevertheless, it does seem that .Net struggles with
            recursive algorithms, which makes it kinda pointless for language
            processing applications.
            Did you profile the .NET solution and verified that it was indeed
            recursion that ate up time? So far all we know is that it relied heavily
            on string parsing and recursion, but without profiling evidence I
            wouldn't assume anything about why it ran slow.

            I have a fairly extensive recursive solution implemented in a system
            that processes gigabytes of log-files each day and recursion was nowhere
            near a bottleneck in that solution. I/O and memory usage (GC) was the
            top two time-spenders in that solution.
            >
            <snip>
            >
            >Now, if you'd hired a .NET developer (not necessarily an expert - just
            >someone who was genuinely familiar with the platform), profiled the
            >app, *tried* to make it perform well, and still failed - *that* would
            >have been good evidence that .NET was slow for your particular
            >situation. (It still wouldn't have been good *general* evidence of
            >course.)
            >
            It would have been a neat trick, actually, since the ink on the box was
            still wet - the only .Net people in the UK at the time were either beta
            testers or liars. :-)
            >
            Considering I'm still learning new ways to eek more performance out of
            ..NET every week I'll venture a guess that your solution wasn't optimal
            either. It might've been the best you could produce but I'll vaguer that
            there is probably a better solution available.

            Would it be able to eat up the 1/60th speed degradation? Probably not,
            but who knows.

            All I'm saying that regardless of your particular solution, .NET isn't
            slow in all respects.

            Pick the best tool for the job. Sounds like you did. Case closed.

            --
            Lasse Vågsæther Karlsen
            mailto:lasse@vk arlsen.no
            Blogger ist ein Veröffentlichungs-Tool von Google, mit dem du ganz einfach deine Gedanken der Welt mitteilen kannst. Mit Blogger kannst du problemlos Texte, Fotos und Videos in deinem persönlichen Blog oder deinem Team-Blog veröffentlichen.

            Comment

            • Miha Markic

              #81
              Re: If not .Net then what?

              To avoid countless further posts, would you be so kind to create a sample
              that shows ~60x (or whatever the factor is) slower code execution?

              --
              Miha Markic [MVP C#, INETA Country Leader for Slovenia]
              RightHand .NET consulting & development www.rthand.com
              Blog: http://cs.rthand.com/blogs/blog_with_righthand/

              Comment

              • Richard Heathfield

                #82
                Re: If not .Net then what?

                Lasse Vågsæther Karlsen said:

                <snip>
                Did you profile the .NET solution and verified that it was indeed
                recursion that ate up time?
                As I said upthread, as far as I can recall we did not succeed at the time
                in working out why the .Net version was so slow.

                <snip>
                Considering I'm still learning new ways to eek more performance out of
                .NET every week I'll venture a guess that your solution wasn't optimal
                I can accept that.

                --
                Richard Heathfield <http://www.cpax.org.uk >
                Email: -http://www. +rjh@
                Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                "Usenet is a strange place" - dmr 29 July 1999

                Comment

                • Jon Skeet [C# MVP]

                  #83
                  Re: If not .Net then what?

                  Lasse Vågsæther Karlsen <lasse@vkarlsen .nowrote:

                  <snip>
                  Pick the best tool for the job. Sounds like you did. Case closed.
                  I'd expand that slightly further:

                  Pick the best tool for the job and for the resources available. I
                  strongly suspect that if the resources available had been experienced
                  C# developers who didn't know native C++, the best tool for the same
                  job would be .NET.

                  --
                  Jon Skeet - <skeet@pobox.co m>
                  http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
                  World class .NET training in the UK: http://iterativetraining.co.uk

                  Comment

                  • Richard Heathfield

                    #84
                    Re: If not .Net then what?

                    Jon Skeet [C# MVP] said:

                    <snip>
                    Do you think that .NET would be widely used at all if it were typically
                    60x slower than native code?
                    Yes, I'm afraid I do.

                    --
                    Richard Heathfield <http://www.cpax.org.uk >
                    Email: -http://www. +rjh@
                    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                    "Usenet is a strange place" - dmr 29 July 1999

                    Comment

                    • Bart C

                      #85
                      Re: If not .Net then what?

                      "Richard Heathfield" <rjh@see.sig.in validwrote in message
                      news:uaSdnbmHc_ M8sOvanZ2dnUVZ8 tuqnZ2d@bt.com. ..

                      [on C++ appl being 60x slower in .Net]
                      Yes, it's a fair point. Nevertheless, it does seem that .Net struggles
                      with
                      recursive algorithms, which makes it kinda pointless for language
                      processing applications.
                      Perhaps you can post the shortest piece of code that shows the problem. Then
                      some of us (not me) might help finding the reasons.

                      Bart


                      Comment

                      • Cor Ligthert[MVP]

                        #86
                        Re: If not .Net then what?

                        Jon,

                        Do you believe in the fable that native code is quicker than code build
                        around efficient routines?
                        Native code is because of the nature which leads to often inneficient use
                        normally slower, which start at the loading time because the size of a
                        native program in memory is forever huger then with efficient routines
                        (what a runtime in fact is).

                        Beside that there is since 1965 probably not anymore one real for general
                        purpose written application in total native code which works without any OS
                        around it. (The OS's were in the beginning in fact nothing more then a kind
                        of runtime).

                        Cor

                        Comment

                        • Richard Heathfield

                          #87
                          Re: If not .Net then what?

                          Bart C said:

                          <snip>
                          Perhaps you can post the shortest piece of code that shows the problem.
                          That's a perfectly sensible request, but alas, the answer is no, I can't do
                          that. This is because the incident in question occurred (several years
                          ago) on a client site - NDA applies, so I wouldn't be able to show the
                          code to you even if I had a copy (which I don't). And since I never use
                          ..Net any more if I can possibly avoid it, I simply don't care enough to
                          construct an example. Sorry.

                          --
                          Richard Heathfield <http://www.cpax.org.uk >
                          Email: -http://www. +rjh@
                          Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                          "Usenet is a strange place" - dmr 29 July 1999

                          Comment

                          • Jon Skeet [C# MVP]

                            #88
                            Re: If not .Net then what?

                            Cor Ligthert[MVP] <notmyfirstname @planet.nlwrote :
                            Do you believe in the fable that native code is quicker than code build
                            around efficient routines?
                            I'm not at all sure what you mean.

                            In some cases I believe that idiomatic native code will be faster than
                            ..NET. In some cases it will be slower. In most cases my experience
                            suggests it will be "about the same".
                            Native code is because of the nature which leads to often inneficient use
                            normally slower, which start at the loading time because the size of a
                            native program in memory is forever huger then with efficient routines
                            (what a runtime in fact is).
                            Um, no. Loading a runtime takes time - this is easy to see when you
                            first run even a small .NET program after boot. A comparable native
                            program is likely to load and start up much quicker. After the
                            framework is in the disk cache, the startup time of .NET improves a lot
                            though.
                            Beside that there is since 1965 probably not anymore one real for general
                            purpose written application in total native code which works without any OS
                            around it. (The OS's were in the beginning in fact nothing more then a kind
                            of runtime).
                            "Native code" in this context is "source code which is compiled
                            directly to machine code". That doesn't prevent it from using standard
                            libraries.

                            --
                            Jon Skeet - <skeet@pobox.co m>
                            http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
                            World class .NET training in the UK: http://iterativetraining.co.uk

                            Comment

                            • Jon Skeet [C# MVP]

                              #89
                              Re: If not .Net then what?

                              Richard Heathfield <rjh@see.sig.in validwrote:
                              Perhaps you can post the shortest piece of code that shows the problem.
                              >
                              That's a perfectly sensible request, but alas, the answer is no, I can't do
                              that. This is because the incident in question occurred (several years
                              ago) on a client site - NDA applies, so I wouldn't be able to show the
                              code to you even if I had a copy (which I don't). And since I never use
                              .Net any more if I can possibly avoid it, I simply don't care enough to
                              construct an example. Sorry.
                              In that case it would probably be worth avoiding the assertion that
                              ..NET is slow in future.

                              --
                              Jon Skeet - <skeet@pobox.co m>
                              http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
                              World class .NET training in the UK: http://iterativetraining.co.uk

                              Comment

                              • Richard Heathfield

                                #90
                                Re: If not .Net then what?

                                Jon Skeet [C# MVP] said:
                                Richard Heathfield <rjh@see.sig.in validwrote:
                                <snip>
                                >I simply don't care enough to construct an example. Sorry.
                                >
                                In that case it would probably be worth avoiding the assertion that
                                .NET is slow in future.
                                Yeah, fair enough - I'll revise it to "100% of the .Net projects I've been
                                involved with have run 60 times slower than their native equivalents". :-)

                                --
                                Richard Heathfield <http://www.cpax.org.uk >
                                Email: -http://www. +rjh@
                                Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                                "Usenet is a strange place" - dmr 29 July 1999

                                Comment

                                Working...