Saturday, January 16, 2016

Managed code and unmanaged code efficiency comparison problem




            


Yesterday in the browser when a contestant housisong's blog this article switched others find the content is about managed code efficiency than the problem of low unmanaged code, the author also brought the contest code has been tested, and now share with everyone, Because there are a lot of code is executed after the image, so the direct address made up, we can go and see: http: //www.cnblogs.com/wuchang/archive/2006/12/07/584997.html


In addition, housisong also against this article do further testing and comparison, because the same image problem, and here I quote only the address: http: //blog.csdn.net/housisong/archive/2007/01/18/1486504. aspx


Reply:
I saw him after that test comparison is unfair, so I myself did a test, and try to make them more fair comparison can (of course, can not be said to be totally fair);

The results are found in managed code and native code has been very close in performance! And it makes it difficult to believe that Managed C ++ generated code has been close to the native C ++ code; (just started a little do not believe, went to check a bit Managed C ++ generates bytecode, which is entirely .net bytecode; can certainly it should be run only when further compiled to machine code to be executed); that managed code is entirely possible, in principle, meet or exceed native compiled code!
This to me is a very concept of change; the previously known managed code may be beyond the native code, but always thought that there is not even close, but I never thought this day would come so soon!
Reply:
Results customers look to run, it does not want to control access to those bytes are not close to the native code.
The results of running managed code is slow
Reply:
to: zjh222 (zjh)
& Gt; & gt; "the result is the managed code running slow"

You may not see my comparative test results, test (not comprehensive reference purposes only) Managed C ++ only 10% slower than unmanaged C ++ only, rather than the managed hosting Delphi rate has been below code!

& Gt; & gt; ". The results customers look to run, it does not want to control access to those bytes are not close to the native code of"

For; however, we have to sharpen the weapons of our programmers use; assumes that the user is only required to achieve a certain function make,
And some kind of development language development efficiency is much higher than another language, you will choose which?
This means that for the company competitive and is able to survive; so the language was not completely ignored;
Customers see the results, and will watch your speed of delivery, but also look at interactive experience, and is easy to maintain and so on;
Improve the performance of managed code means that some previously for native code development occasions now managed code may be more appropriate;
Reply:
Learning, the top one
Reply:
If it is from the principle of speaking, then, personally I feel that managed code can not be faster than unmanaged. Because the program runs on .Net intermediate language level. Some people say that Java faster than C ++, it is even more impossible, because Java is interpreted, but C ++ is compiled, it is not comparable
Reply:
C # or Managed C ++ generated pseudo-code, but they are not interpreted, that Java is the same, they are compiled, but compiled with different timing, the traditional after completing compiled machine code, such First compiled into pseudo-code, when compiled to machine code before execution, are running the machine code, nor is it an explanation of a run, but to compile the whole assembly is then loaded operation, run-time efficiency equal to conventional procedures.

May be even higher, mainly localized compiler can optimize the instruction, for example, can take a different compilation methods differ according to CPU.
Reply:
Affect the efficiency of the part is not to interpret or compile.

This managed code, a complete run-time type information dynamically at runtime to match the type of inspection, the traditional type checking at compile time, but bring that way either wrong, or can not compile. Also affect the efficiency of border checks, stack overflow checking, etc. Check the input and output, as well as automatic garbage collection will affect the operating efficiency. In addition, the managed code as well as check code execution privileges will also affect speed.

However, these effects, compared to the program's robust, secure, which have nothing of.
Reply:
learned
Reply:
Are wondering, the experts were eager to express their opinions. Let me refer to the study and other novices.

No comments:

Post a Comment