This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients josh.r, jtaylor, neologix, njs, pitrou, skrah, vstinner
Date 2014-04-27.23:15:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398640548.12.0.00484967905945.issue21233@psf.upfronthosting.co.za>
In-reply-to
Content
bench_alloc2.py: updated benchmark script. I added bytes(n) and bytearray(n) tests and removed the test decoding from ASCII.

Common platform:
Timer: time.perf_counter
Timer info: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09)
Platform: Linux-3.13.9-200.fc20.x86_64-x86_64-with-fedora-20-Heisenbug
SCM: hg revision=4b97092aa4bd+ tag=tip branch=default date="2014-04-27 18:02 +0100"
Python unicode implementation: PEP 393
Bits: int=32, long=64, long long=64, size_t=64, void*=64
CFLAGS: -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
CPU model: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz

Platform of campaign orig:
Date: 2014-04-28 01:11:49
Timer precision: 39 ns
Python version: 3.5.0a0 (default:4b97092aa4bd, Apr 28 2014, 01:02:01) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)]

Platform of campaign calloc:
Date: 2014-04-28 01:12:29
Timer precision: 44 ns
Python version: 3.5.0a0 (default:4b97092aa4bd+, Apr 28 2014, 01:06:54) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)]

-----------------------+-------------+----------------
Tests                  |        orig |          calloc
-----------------------+-------------+----------------
object()               |   62 ns (*) |    72 ns (+16%)
b'A' * 10              |   53 ns (*) |           52 ns
b'A' * 10**3           |   96 ns (*) |   110 ns (+15%)
b'A' * 10**6           | 38.5 us (*) |         38.6 us
'A' * 10               |   59 ns (*) |           61 ns
'A' * 10**3            |  105 ns (*) |          108 ns
'A' * 10**6            | 38.6 us (*) |         38.6 us
'A' * 10**8            | 10.3 ms (*) |         10.4 ms
(None,) * 10**0        |   29 ns (*) |           29 ns
(None,) * 10**1        |   75 ns (*) |           76 ns
(None,) * 10**2        |  432 ns (*) |    461 ns (+7%)
(None,) * 10**3        | 3.58 us (*) |          3.6 us
(None,) * 10**4        | 35.8 us (*) |         35.7 us
(None,) * 10**5        |  365 us (*) |          365 us
(None,) * 10**6        |  4.1 ms (*) |         4.13 ms
(None,) * 10**7        | 43.6 ms (*) |   40.3 ms (-8%)
(None,) * 10**8        |  433 ms (*) |    401 ms (-7%)
([None] * 10)[1:-1]    |  122 ns (*) |   134 ns (+10%)
([None] * 10**3)[1:-1] |  3.6 us (*) |         3.62 us
([None] * 10**6)[1:-1] | 4.22 ms (*) |          4.2 ms
([None] * 10**8)[1:-1] |  441 ms (*) |    402 ms (-9%)
bytes(10)              |  137 ns (*) |          136 ns
bytes(10**3)           |  181 ns (*) |    191 ns (+5%)
bytes(10**6)           | 38.7 us (*) |         39.2 us
bytes(10**8)           | 10.3 ms (*) | 4.36 us (-100%)
bytearray(10)          |  138 ns (*) |   153 ns (+11%)
bytearray(10**3)       |  184 ns (*) |   211 ns (+14%)
bytearray(10**6)       | 38.7 us (*) |         39.3 us
bytearray(10**8)       | 10.3 ms (*) | 4.32 us (-100%)
-----------------------+-------------+----------------
Total                  |  957 ms (*) |   862 ms (-10%)
-----------------------+-------------+----------------
History
Date User Action Args
2014-04-27 23:15:48vstinnersetrecipients: + vstinner, pitrou, njs, skrah, neologix, jtaylor, josh.r
2014-04-27 23:15:48vstinnersetmessageid: <1398640548.12.0.00484967905945.issue21233@psf.upfronthosting.co.za>
2014-04-27 23:15:48vstinnerlinkissue21233 messages
2014-04-27 23:15:47vstinnercreate