From 6eec689baf1079265d8338edfcfa1f3534d94d5d Mon Sep 17 00:00:00 2001 From: Cedric Porter Date: Tue, 31 Jul 2012 15:32:07 +0800 Subject: [PATCH] =?UTF-8?q?o(=E2=88=A9=E2=88=A9)o...=E5=93=88=E5=93=88?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EffectLab/Makefile | 4 ++-- TestEffectLab.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/EffectLab/Makefile b/EffectLab/Makefile index 918c997..5344f2f 100644 --- a/EffectLab/Makefile +++ b/EffectLab/Makefile @@ -1,5 +1,5 @@ EffectLabCore.so: core.c - gcc -I/usr/include/python2.7 -fPIC -shared core.c -o EffectLabCore.so + gcc -O2 -I/usr/include/python2.7 -fPIC -shared core.c -o EffectLabCore.so clean: - rm *.so \ No newline at end of file + rm *.so diff --git a/TestEffectLab.py b/TestEffectLab.py index fd090cd..9126d0b 100755 --- a/TestEffectLab.py +++ b/TestEffectLab.py @@ -89,4 +89,15 @@ def main(): if __name__ == '__main__': os.system('rm tmp/*') # autoreload.main(main) - main() + # main() + from timeit import Timer + from functools import partial + + img = Image.new("RGB", (100, 100)) + wave = GlobalWaveEffect(1, 0.5) + test = partial(wave, img) + + t = Timer('test()', 'from __main__ import test') + + print avg(t.repeat(3, 100)) +