Author vstinner
Recipients josh.r, llllllllll, martin.panter, python-dev, serhiy.storchaka, vstinner, yselivanov
Date 2016-04-19.21:14:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1461100483.71.0.154244272017.issue26802@psf.upfronthosting.co.za>
In-reply-to
Content
Good news. On a microbenchmark, the patch makes func(*tuple) between 14% and 18% faster. See attached bench.py. I ran the benchmark on Linux with isolated CPUs to get reliable results.
https://haypo-notes.readthedocs.org/microbenchmark.html

$ ./python-orig ~/prog/HG/misc/python/benchmark.py script bench.py --file=orig
$ ./python-patched ~/prog/HG/misc/python/benchmark.py script bench.py --file=patch
$ ./python-orig ~/prog/HG/misc/python/benchmark.py compare_to orig patch

Common platform:
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
SCM: hg revision=75f40345d784 branch=default date="2016-04-19 22:29 +0200"
Timer info: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09)
Timer: time.perf_counter
Bits: int=32, long=64, long long=64, size_t=64, void*=64
Python unicode implementation: PEP 393
CFLAGS: -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
Platform: Linux-4.4.4-301.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three

Platform of campaign orig:
Timer precision: 62 ns
Python version: 3.6.0a0 (default:75f40345d784, Apr 19 2016, 23:07:49) [GCC 5.3.1 20151207 (Red Hat 5.3.1-2)]
Date: 2016-04-19 23:08:21

Platform of campaign patch:
Timer precision: 61 ns
Python version: 3.6.0a0 (default:084d5315dd50, Apr 19 2016, 23:06:38) [GCC 5.3.1 20151207 (Red Hat 5.3.1-2)]
Date: 2016-04-19 23:08:39

-----------------------------------------------------+------------+--------------
Tests                                                |       orig |         patch
-----------------------------------------------------+------------+--------------
def func(a, b, c): pass args=(1, 2, 3); func(*args)  | 127 ns (*) | 104 ns (-18%)
def func(*args): pass args=(1, 2, 3); func(*args)    | 147 ns (*) | 126 ns (-14%)
def func(*args): pass args=(2, 3, 4); func(1, *args) | 154 ns (*) |        154 ns
-----------------------------------------------------+------------+--------------
Total                                                | 429 ns (*) | 384 ns (-10%)
-----------------------------------------------------+------------+--------------
History
Date User Action Args
2016-04-19 21:14:43vstinnersetrecipients: + vstinner, python-dev, martin.panter, serhiy.storchaka, yselivanov, josh.r, llllllllll
2016-04-19 21:14:43vstinnersetmessageid: <1461100483.71.0.154244272017.issue26802@psf.upfronthosting.co.za>
2016-04-19 21:14:43vstinnerlinkissue26802 messages
2016-04-19 21:14:43vstinnercreate