Object-oriented and process-oriented Comparison

  Why do some people would say that the process of performance-oriented than object-oriented? Object-oriented language easy to maintain and reuse, easy to expand. With java example, because Java has encapsulation, inheritance, polymorphism characteristics, it is possible to design a low coupling system, make the system more flexible and easier to maintain. But when the need to instantiate Java class called, so overhead is relatively large, more consumption of resources.
  The above is not the root cause, but also needs to allocate memory for the process, and calculates the offset amount. Java is a semi-compiled language, the binary machine code execution is not the final code can be executed directly in the CPU, and process-oriented language most directly compiled into machine code to run on a computer, this is the main reason. The first performance of the program and implementation of the relevant programming language, followed by the design paradigm. In C and C ++, for example, two different design ideas, but similar efficiency, the fundamental reason is that their operation mechanism is the same.
  The speed of modern computers soon, as long as the scene is not the most important performance factors such as microcontrollers, embedded development, the advantages of an object-oriented language in the development efficiency is obvious. Java Virtual Machine in the implementation section also introduces just in time compiler (JIT) to optimize the operating mechanism of Java programs.
  

Guess you like

Origin www.cnblogs.com/lshuoshuo/p/11617579.html