summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@xander>2011-02-04 22:08:50 +0200
committerLars Wirzenius <liw@xander>2011-02-04 22:08:50 +0200
commit4f855b71e11646da6d95bc2e081bd4083cf20a5a (patch)
tree8b01003e910048f0ed3ea0ff284372a59b62cf77
parented28708bd80bfd298dcbbb9100d4c9f7c34f9bc5 (diff)
downloadpython-tracing-4f855b71e11646da6d95bc2e081bd4083cf20a5a.tar.gz
Add more measurements.
-rwxr-xr-xspeed-test21
1 files changed, 20 insertions, 1 deletions
diff --git a/speed-test b/speed-test
index 5184b70..05736a3 100755
--- a/speed-test
+++ b/speed-test
@@ -2,7 +2,26 @@
set -e
+measure() {
python -m timeit \
-s 'import logging, tracing' \
-s 'logging.basicConfig(filename="/dev/null")' \
- 'tracing.trace("foo: %s" % "bar")'
+ -s "$1" \
+ -s '
+class Foo(object):
+ def foo(self):
+ tracing.trace("%s" % "bar")
+f = Foo()
+' \
+ 'f.foo()'
+
+}
+
+echo Without patterns
+measure "pass"
+
+echo With unmatching pattern
+measure 'tracing.trace_add_pattern("yikes")'
+
+echo With matching pattern
+measure 'tracing.trace_add_pattern("timeit-src")'