Python project performance testing

Outline

Application performance characteristics measured during pressing viewed mainly tps and response time. After Python2.5 cProfile Code comes time performance monitoring

Detailed

jvm only can also be run to run java php, Python, ruby ​​program bytecode. Source language interpreter will jvm bytecode translation into another intermediate language interpreted as Grovey, Jython, so the speed of the speed of the intermediate language is critical whether excellent performance.

Glossary

JVM: a way to run Java bytecode ( Java  bytecode) virtual machine. Now not just only JVM to run Java programs, there have been a number of scripts to use the Java virtual machine running on a JVM, such as what PHP, Python, Ruby, etc. (Figure 5)

Byte code: bytecode is has been built, but nothing to do with the specific machine code, the need to become the interpreter translates the intermediate code machine code.

Java bytecode: format is a Java virtual machine instruction executed.

Interpreter : a computer program that is a separate language, can escape the high-level language line by line to run. It will first be translated into another language source code (Grovey, Jython), without the need for multiple runs and then compiled. Its products without relying on the compiler and run the program run faster. Reference Figure three

grovey: seamless integration of all Java objects and libraries that already exist. Directly compiled into Java byte code

Jython : Jython is a complete language, rather than a Java interpreter or just a Python compiler , which is a Python language fully implemented in Java. Jython, there are many inherited from CPython in the module library. The most interesting thing is Jython or CPython unlike any other high-level language, which provides access to all their implementation language. So Jython not only give you a Python library, while also providing all of the Java classes. This makes it a great resource.

monitor

cProfile : Python cProfile -m -s tottime your_program.py one time application monitoring tools: monitoring program of each line of code

  FIG. (A)

ncalls: function total number of calls

tottime: This function takes a total call time

percall: Average time spent per call

cumtime: total cumulative time spent

percall: cumulative average time per call

filename: Name

 

Diagram

Python has no virtual machine? Where Python code runs in?

figure 2

 image 3

 

 Figure 4

 

 Figure 5

 

Reference links:

https://blog.csdn.net/weixin_40304570/article/details/79459811

https://blog.csdn.net/weixin_34144848/article/details/90557228

https://baike.baidu.com/item/%E8%A7%A3%E9%87%8A%E5%99%A8/10418965?fr=aladdin

https://www.cnblogs.com/chengdabelief/p/6576320.html

https://www.php.cn/python-tutorials-423340.html

 

Guess you like

Origin www.cnblogs.com/wangdadada/p/12194680.html