• 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!

.NET Core Real Contractor Challenge

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

    #11
    Originally posted by woohoo View Post
    Yep, create a byte array with the assembler instructions, copy to area of executable memory
    (virtualallocex). Next, create a delegate then get a function pointer for the assembler code bytes.

    Call the delegate.

    Tidy up.
    Now you've done it!

    He's gone off to kick a squirrel!

    Willy Wonka had his tribe of amiable black pygmies, AtW has his Squirrels!
    Old Greg - In search of acceptance since Mar 2007. Hoping each leap will be his last.

    Comment


      #12
      Originally posted by woohoo View Post
      Yep, create a byte array with the assembler instructions, copy to area of executable memory
      (virtualallocex). Next, create a delegate then get a function pointer for the assembler code bytes. Call the delegate. Tidy up.
      That's an expensive function call, I want it to be inlined by JIT.

      NEXT!

      Comment


        #13
        Originally posted by Zigenare View Post
        Try using a decent search engine!!!!

        Not found using Majestic-12
        DLL call are very expensive in C#, only works if you do a LOT of work in the call, so totally unsuitable for purposes of having very frequently called function that is very optimised.

        I could always hack .NET Core code and create a new BCL function with C+assembly in it that will be compiled as part of framework, but that would require me maintaining it, I'd much rather prefer more generic approach with the language itself allowing asm {} and taking care of getting correct references to function params and variables into assembly code, much like C/C++ do.

        Nice try, amateurs, but no cigar.

        Comment


          #14
          Originally posted by AtW View Post
          ... and taking care of getting correct references to function params and variables into assembly code, much like C/C++ do.
          Maybe that last bit might help you realise that if you need to be that close to the metal, using a managed language is probably not the right tool for the job.

          HTH BIDI

          Comment


            #15
            Originally posted by DimPrawn View Post
            Maybe that last bit might help you realise that if you need to be that close to the metal, using a managed language is probably not the right tool for the job.
            Facebook used PHP, time to market matters, later they’ve spent a fair amount of money to speed it up, had they started with C/assembly they would have never finished.

            Don’t expect you to understand it since you don’t run a real business...

            Comment


              #16
              Buy a Z13s

              Comment


                #17
                Oh well, no surprises here - nobody on here can do it (apart from me, but I am too busy with other stuff), and people on here claim there is no skills shortage...

                Comment


                  #18
                  Originally posted by AtW View Post
                  Oh well, no surprises here - nobody on here can do it (apart from me, but I am too busy with other stuff), and people on here claim there is no skills shortage...
                  I told you how to do it. Then you decided to add requirements for performance.

                  If you give some details about the assembler code, how often it’s ran and performance requirements, I will be happy to knock something up.

                  Comment


                    #19
                    Originally posted by AtW View Post
                    Oh well, no surprises here - nobody on here can do it (apart from me, but I am too busy with other stuff), and people on here claim there is no skills shortage...
                    Erm ... what’s in it for any of us to fix some performance issue you have with your search engine? Can you not hire some contractor for this?
                    Vote Corbyn ! Save this country !

                    Comment


                      #20
                      Originally posted by woohoo View Post
                      I told you how to do it. Then you decided to add requirements for performance.

                      If you give some details about the assembler code, how often it’s ran and performance requirements, I will be happy to knock something up.
                      Why would somebody want to write assembly code if it was not for performance? No wonder you voted for Brexit!

                      Assembly code should be anything I can do in normal C/C++ - can target just x64 (no need for cross platform), but I want convenience of writing it in C# rather than having to recompile framework itself - this is again for performance reasons, of a programmer.

                      Assembly will only be used for functions that will be called a lot - millions of times per second.
                      Last edited by AtW; 18 October 2018, 10:26.

                      Comment

                      Working...
                      X