Explain why managed code is slower than unmanaged code.- Managed code is not always slower than unmanaged code. - In managed code, the CLR does some optimization for the way loops, subroutines should run and what is the best way to execute it. - Managed code executes under the management of a virtual machine. - It is executed by a common language runtime environment rather than directly by the operating system. - Tasks such as Exception handling and GC too are handled in the managed code environment. - Due to all these reasons, managed code is slower than the unmanaged code.
|