• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

FFS Microsoft

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    FFS Microsoft

    FFS, had to dig into .NET source code to rewrite their Array.Sort code that was slow as a dog. Dim - what's their address to send invoice to?

    #2
    www.rentboyz.com

    Comment


      #3
      Isn't that a good thing? Kerching...!

      Comment


        #4
        Send the invoice to

        Bill and Melinda Gates Foundation
        Billionaires Way
        Redmond
        Seattle
        US


        HTH

        Comment


          #5
          Originally posted by AtW
          FFS, had to dig into .NET source code to rewrite their Array.Sort code that was slow as a dog. Dim - what's their address to send invoice to?
          The .NET array sort code is a quick sort algorithm. What did you replace it with?

          Comment


            #6
            Another FFS Microsoft....

            http://www.youtube.com/watch?v=fV1kqthZf2g

            Vista and speech recog...

            I really don't understand why MS Product Managers do this to themselves...
            http://nickmueller.blogspot.com/

            Comment


              #7
              I improved the code but more importantly made sure the right sorter gets called, look at their source here, line 00844.

              Notice that they would try to use non-.NET SZsort first, if it fails or some conditions set then they will try SorterObjectArray - this is much slower, but still okay, but they may also fall to the slowest piece of sh1t of a code SorterGenericArray: in profiler I could see that they were falling to it without good reason. So I took SorterObjectArray code and made sure it works with explicit types to allow compiler made optimisations, unlike ******** Microsoft programmers I am not lazy to copy paste same code with small changes to mak esure its optimised to the max. Say look at their code checking for presense of items:

              if (items != null)
              { // do stuff
              }

              They do it in one tight loop, ffs, you can check it ONCE before calling that code and decide to call correct path to avoid making comparison that will yield same result all the time, ffs, sometimes copy/paste/lil-change approach is the best way to max performance.

              FFS, and look at SorterObjectArray - because they forced Array.Sort to deal with arrays type of object[] it means they had to use Comparer, thus calling Int32 comparer on object rather than creating dozen copies of Array.Sort to deal with ALL primitive type combinations. FFS, this is obvious and certainly no excuse not to do in the base library that must be ultra fast!!!

              It pissed me off big time that they were calling the slowest sorter of them all when I tried to sort int[],int[] arrays ffs, the difference is so big that its criminal to not spend 1 days making sure sorting is lighting fast - the base library code is not written for show of how one big superfunction can do it all ffs.
              Last edited by AtW; 1 August 2006, 14:41.

              Comment


                #8
                Well you know best AtW

                Comment


                  #9
                  I know better, but I am not the best programmer out there - .NET is done well, but its appauling to see such obvious lack of optimisations: clearly programmer optimised for his own writing time, ie think less and write just one easily maintainable version of Sorter, so he used object[] params, rather than specific int[] params (which is kind of done using Generics in .NET 2.0 but hard coded types are always better performance wise), also annoying that IF statement that will always be used but could have only checked once, its a recursive function ffs, and its sorting so clearly performance in this area is important especially because everyone is using same algorithm (quicksort), so optimising implementation is totally essential: I've done this small rewrite and sorting dropped off my radar now so I can look at other parts of my code. Bastards.

                  Comment


                    #10
                    It's all got a bit techie in here. I was just hoping for a bit of Gate$ bashing.

                    Comment

                    Working...
                    X