summaryrefslogtreecommitdiff
path: root/speed-test
blob: 76e6b9a210bf05a912339caaec948e863036eef4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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")'