diff options
author | Lars Wirzenius <liw@xander> | 2011-02-04 22:21:22 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@xander> | 2011-02-04 22:21:22 +0200 |
commit | 9ec4c1dab031f14041dd363428100136f7079fa3 (patch) | |
tree | 9d682df5eb9a5be7068b874810b2fe9a601579b8 /speed-test | |
parent | 67aca5f5bc86673a59ccbadc5ec3c3e4984b52a0 (diff) | |
parent | 7c08f99a8f0e8d12afb8adb6966f4bb3262c8697 (diff) | |
download | python-tracing-9ec4c1dab031f14041dd363428100136f7079fa3.tar.gz |
Merge speed test and optimizations.
Diffstat (limited to 'speed-test')
-rwxr-xr-x | speed-test | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/speed-test b/speed-test new file mode 100755 index 0000000..76e6b9a --- /dev/null +++ b/speed-test @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +measure() { +python -m timeit \ + -s 'import logging, tracing' \ + -s 'logging.basicConfig(filename="/dev/null")' \ + -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")' |