Author vstinner
Recipients josh.r, mark.dickinson, rhettinger, serhiy.storchaka, vstinner, zbyrne
Date 2014-07-16.08:13:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405498394.73.0.876804145678.issue21955@psf.upfronthosting.co.za>
In-reply-to
Content
bench_long.py: micro-benchmark for x+y. I confirm a slow down with 21955.patch. IMO you should at least inline PyLong_AsLong() which can be simplified if the number has 0 or 1 digit. Here is my patch "inline.patch" which is  21955.patch  with PyLong_AsLong() inlined.

Benchmark result (patch=21955.patch, inline=inline.patch):

Common platform:
Timer precision: 40 ns
CFLAGS: -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
Timer info: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09)
Bits: int=32, long=64, long long=64, size_t=64, void*=64
Timer: time.perf_counter
Python unicode implementation: PEP 393
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Platform: Linux-3.14.8-200.fc20.x86_64-x86_64-with-fedora-20-Heisenbug

Platform of campaign orig:
Date: 2014-07-16 10:04:27
Python version: 3.5.0a0 (default:08b3ee523577, Jul 16 2014, 10:04:23) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577 tag=tip branch=default date="2014-07-15 13:23 +0300"

Platform of campaign patch:
Date: 2014-07-16 10:04:01
Python version: 3.5.0a0 (default:08b3ee523577+, Jul 16 2014, 10:02:12) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)]
SCM: hg revision=08b3ee523577+ tag=tip branch=default date="2014-07-15 13:23 +0300"

--------------------+-------------+--------------
Tests               |        orig |         patch
--------------------+-------------+--------------
1+2                 |   23 ns (*) |         24 ns
"1+2" ran 100 times | 1.61 us (*) | 1.74 us (+7%)
--------------------+-------------+--------------
Total               | 1.64 us (*) | 1.76 us (+7%)
--------------------+-------------+--------------
History
Date User Action Args
2014-07-16 08:13:51vstinnerunlinkissue21955 messages
2014-07-16 08:13:14vstinnersetrecipients: + vstinner, rhettinger, mark.dickinson, serhiy.storchaka, josh.r, zbyrne
2014-07-16 08:13:14vstinnersetmessageid: <1405498394.73.0.876804145678.issue21955@psf.upfronthosting.co.za>
2014-07-16 08:13:14vstinnerlinkissue21955 messages
2014-07-16 08:13:13vstinnercreate