Commit aae7ed82 authored by Kirill Smelkov's avatar Kirill Smelkov

X compilebench: Also measure python compile/import and cython times

Cython is currently slow:

	name                time/op
	pycompile+pyimport  13.0ms ± 0%
	pyimport            12.0ms ± 0%
	cython/py            983ms ± 1%
parent ec14f9e5
......@@ -4,11 +4,7 @@
export LANG=C.UTF-8 # . for floating point in e.g. time output
git clean -fdX
cp pystone.py pystone_pypyx.py # to be sure that 'import pystone_pypyx' does not pick up py code
cython -2 pystone_pypyx.py # -> pystone_pypyx.c
wc -l pystone_pypyx.{py,c}
rm pystone_pypyx.py
CFLAGS="-pthread -DNDEBUG -fwrapv -O0 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -fPIC -I/usr/include/python2.7"
......@@ -39,6 +35,31 @@ pystone2bench() {
N=10
# python: pycompile + pyimport
for i in `seq $N`; do
rm -f pystone.pyc
export TIMEFORMAT="Benchmarkpycompile+pyimport 1 %R s/op"
time python -c 'import pystone'
done
# python: pyimport with .pyc already being there
python -c 'import pystone'
for i in `seq $N`; do
export TIMEFORMAT="Benchmarkpyimport 1 %R s/op"
time python -c 'import pystone'
done
# cython pystone.py
for i in `seq $N`; do
cp pystone.py pystone_pypyx.py # to be sure that 'import pystone_pypyx' does not pick up py code
export TIMEFORMAT="Benchmarkcython/py 1 %R s/op"
time cython -2 pystone_pypyx.py # -> pystone_pypyx.c
#wc -l pystone_pypyx.{py,c}
rm pystone_pypyx.py
done
# pystone.py
for i in `seq $N`; do
python pystone.py |pystone2bench py
done
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment