python perf: adding pypy, remove a cache-bypass, rust in release mode.

This commit is contained in:
Julien Palard 2023-10-09 23:11:27 +02:00
parent 5e80699b87
commit 7341368eba
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
1 changed files with 12 additions and 7 deletions

View File

@ -467,6 +467,16 @@ Numba est un `JIT` : « Just In Time compiler ».
## numba — À vous !
# pypy
pypy est un interpréteur Python écrit en Python.
```shell
#!cache pyperf timeit --setup 'from examples.collatz_length import collatz_length' 'collatz_length(837799)'
#!cache pypy3 -m pyperf timeit --setup 'from examples.collatz_length import collatz_length' 'collatz_length(837799)'
```
# mypyc
mypyc est un compilateur qui s'appuie sur les annotationes de type mypy :
@ -537,15 +547,10 @@ $ python -m nuitka --module collatz_length_nuitka.py
```shell
#!cache pyperf timeit --setup 'from examples.collatz_length import collatz_length' 'collatz_length(837799)'
#!cache --force -- pyperf timeit --setup 'from examples.collatz_length_nuitka import collatz_length' 'collatz_length(837799)'
#!cache pyperf timeit --setup 'from examples.collatz_length_nuitka import collatz_length' 'collatz_length(837799)'
```
# Et d'autres…
https://github.com/pfalcon/awesome-python-compilers
# Hand crafted C
```c
@ -594,5 +599,5 @@ $ pip install rustimport
```bash
#!cache pyperf timeit --setup 'from examples.collatz_length import collatz_length' 'collatz_length(837799)'
#!cache pyperf timeit --setup 'import rustimport.import_hook; from examples.collatz_length_rs import collatz_length' 'collatz_length(837799)'
#!cache pyperf timeit --setup 'import rustimport.import_hook; import rustimport.settings; rustimport.settings.compile_release_binaries = True; from examples.collatz_length_rs import collatz_length' 'collatz_length(837799)'
```