what's the differences python3 and pypy3
Kindly check this, when we speak of Python programming language we often mean not just the language but also the implementation. Python is a specification for a language that can be implemented in many different ways.
The default implementation of the Python programming language is Cpython(assuming python3 you mean Cpython). As the name suggests Cpython is written in C language. Cpython compiles the python source code into intermediate bytecode, which is executed by the Cpython virtual machine.
Jython is an implementation of the Python programming language that can run on the Java platform. Jython programs use Java classes instead of Python modules. Jython compiles into Java byte code, which can then be run by Java virtual machine.
PyPy If you want your code to run faster, you should probably just use PyPy. — Guido van Rossum (creator of Python) Python is a dynamic programming language. Python is said to be slow as the default CPython implementation compiles the python source code in bytecode which is slow as compared to machine code(native code). Here PyPy comes in.
PyPy is an implementation of the Python programming language written in Python. The Interpreter is written in RPython (a subset of Python). PyPy uses Just In Time (JIT) compilation. In simple terms, JIT uses compilation methods to make the interpreter system more efficient and fast. So basically JIT makes it possible to compile the source code into native machine code which makes it very fast. PyPy also comes with default support for stackless mode, providing micro-threads for massive concurrency. Python is said to be approximately 7.5 times faster than Cpython.
Hope this will help you.
It is interpreter for python language written in C and C++. Interpreter convert python code (which is written by humans and can be read by humans) to machine code (which can be read/understood by machines). This process involve various steps.
CPython is the reference implementation of Python, written in C. It compiles Python code to intermediate bytecode which is then interpreted by a virtual machine. CPython provides the highest level of compatibility with Python packages and C extension modules.
If you are writing open source Python code and want to reach the widest possible audience, targeting CPython is best. To use packages which rely on C extensions to function, CPython is your only implementation option.
All versions of the Python language are implemented in C because CPython is the reference implementation.
It is JIT compiler for python language written in RPython. JIT compiler execute code which require compilation, i.e. JIT compile code at runtime, just before executing it.
PyPy is a Python interpreter implemented in a restricted statically-typed subset of the Python language called RPython. The interpreter features a just-in-time compiler and supports multiple back-ends (C, CLI, JVM).
PyPy aims for maximum compatibility with the reference CPython implementation while improving performance.
If you are looking to increase performance of your Python code, it’s worth giving PyPy a try. On a suite of benchmarks, it’s currently over 5 times faster than CPython.
PyPy supports Python 2.7. PyPy3, released in beta, targets Python 3.
I assume that when you say
python3, you mean
CPython which default and widely used implementation of python language.
It is interpreter for python language written in
C and C++. Interpreter convert python code(which is written by human and can read by human) to machine code(which can read/understand by machine/computer). This process involve various steps.
It is JIT compiler for python language written in
RPython. JIT compiler execute code which require compilation, i.e. JIT compile code at runtime, just before executing it.
This different approach of handling python code of these two implementation is reason behind different int speed. Below link will give you more detail on this.
There are few more implementation of Python language which aims to achieve different goal.
Design of CPython’s Compiler