Commit 26ad1917 authored by Kirill Smelkov's avatar Kirill Smelkov

X compilebench: Rewok compile/link/compile+link to not hardcode on what to work

In preparation to add pystone_pyx.pyx
parent 42dccdf8
......@@ -12,16 +12,22 @@ rm pystone_pypyx.py
CFLAGS="-pthread -DNDEBUG -fwrapv -O0 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -fPIC -I/usr/include/python2.7"
compileit() {
$CC $CFLAGS "$@" -c pystone_pypyx.c -o pystone_pypyx.o
# compile <name>
compile() {
name=$1; shift
$CC $CFLAGS "$@" -c $name.c -o $name.o
}
linkit() {
$CC $CFLAGS "$@" -shared pystone_pypyx.o -o pystone_pypyx.so
# link <name>
link() {
name=$1; shift
$CC $CFLAGS "$@" -shared $name.o -o $name.so
}
# compileandlink <name>
compileandlink() {
$CC $CFLAGS "$@" -shared pystone_pypyx.c -o pystone_pypyx.so
name=$1; shift
$CC $CFLAGS "$@" -shared $name.c -o $name.so
}
# pystone2bench <subj> converst pystone output into go benchmark format
......@@ -44,17 +50,17 @@ for CC in gcc tcc; do
for i in `seq $N`; do
export TIMEFORMAT="Benchmark${CC}compile 1 %R op/s"
time compileit
time compile pystone_pypyx
done
for i in `seq $N`; do
export TIMEFORMAT="Benchmark${CC}link 1 %R op/s"
time linkit
time link pystone_pypyx
done
for i in `seq $N`; do
export TIMEFORMAT="Benchmark${CC}compile+link 1 %R op/s"
time compileandlink
time compileandlink pystone_pypyx
done
for i in `seq $N`; do
......@@ -68,7 +74,7 @@ for CC in gcc tcc; do
for i in `seq $N`; do
export TIMEFORMAT="Benchmark${CC}compile+linkO2 1 %R op/s"
time compileandlink "-O2"
time compileandlink pystone_pypyx "-O2"
done
for i in `seq $N`; do
......
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