From 06bad72ecc2b7d107b38b132eda1b2375c5b4152 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 24 Jul 2018 22:36:23 +0200 Subject: [PATCH] Further improvements to benchmark code --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2fcebad..141685f 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR) MODNAME = xattr.so RSTFILES = doc/index.rst doc/module.rst NEWS README.rst doc/conf.py PYVERS = 2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 +REPS = 5 all: doc test @@ -46,13 +47,13 @@ benchmark: $(MODNAME) echo Benchmarking with python$$ver; \ python$$ver ./setup.py build -q; \ echo " - set (with override)"; \ - python$$ver -m timeit -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello')"; \ + python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello')"; \ echo " - list"; \ - python$$ver -m timeit -s 'import xattr' "xattr.list('$$TESTFILE')"; \ + python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.list('$$TESTFILE')"; \ echo " - get"; \ - python$$ver -m timeit -s 'import xattr' "xattr.get('$$TESTFILE', 'user.comment')"; \ + python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.get('$$TESTFILE', 'user.comment')"; \ echo " - set + remove"; \ - python$$ver -m timeit -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello'); xattr.remove('$$TESTFILE', 'user.comment')"; \ + python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello'); xattr.remove('$$TESTFILE', 'user.comment')"; \ fi; \ done; -- 2.39.5