From 2a05f05f4468bc937e412e94df75da9dce9a6148 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 7 May 2014 21:39:09 +0300 Subject: tests/bench: Add tests for various ways to pass function args. Passing 3 args with keywords is for example 50% slower than via positional args. --- tests/bench/func_args-3.2-kw_3.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/bench/func_args-3.2-kw_3.py (limited to 'tests/bench/func_args-3.2-kw_3.py') diff --git a/tests/bench/func_args-3.2-kw_3.py b/tests/bench/func_args-3.2-kw_3.py new file mode 100644 index 000000000..7f9510684 --- /dev/null +++ b/tests/bench/func_args-3.2-kw_3.py @@ -0,0 +1,10 @@ +import bench + +def func(a, b, c): + pass + +def test(num): + for i in iter(range(num)): + func(c=i, b=i, a=i) + +bench.run(test) -- cgit v1.2.3