diff options
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")' |