[issue19513] Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)
STINNER Victor
report at bugs.python.org
Mon Nov 18 21:32:37 CET 2013
STINNER Victor added the comment:
I checked in list_repr_writer-2.patch, thanks Serhiy for your review.
And now the patch for repr(tuple).
Result of bench_tuple_repr.py:
Common platform:
CFLAGS: -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
Bits: int=32, long=64, long long=64, size_t=64, void*=64
Platform: Linux-3.9.4-200.fc18.x86_64-x86_64-with-fedora-18-Spherical_Cow
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Timer info: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09)
Timer: time.perf_counter
Python unicode implementation: PEP 393
Platform of campaign pyaccu:
SCM: hg revision=fc7ceb001eec tag=tip branch=default date="2013-11-18 21:11 +0100"
Timer precision: 41 ns
Date: 2013-11-18 21:29:45
Python version: 3.4.0a4+ (default:fc7ceb001eec, Nov 18 2013, 21:29:41) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)]
Platform of campaign writer:
SCM: hg revision=fc7ceb001eec+ tag=tip branch=default date="2013-11-18 21:11 +0100"
Timer precision: 39 ns
Date: 2013-11-18 21:28:53
Python version: 3.4.0a4+ (default:fc7ceb001eec+, Nov 18 2013, 21:28:24) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)]
------------------------------+-------------+---------------
Tests | pyaccu | writer
------------------------------+-------------+---------------
tuple("a") | 355 ns (*) | 318 ns (-11%)
tuple("abc") | 492 ns (*) | 481 ns
("a",)*(100) | 8.1 us (*) | 7.39 us (-9%)
("abc",)*(100) | 8.16 us (*) | 7.51 us (-8%)
("a" * 100,)*(100) | 35.2 us (*) | 36.3 us
("a",)*(10**6) | 88 ms (*) | 75.9 ms (-14%)
("abc",)*(10**6) | 88.5 ms (*) | 75.3 ms (-15%)
("a" * 100,)*(10**5) | 44.8 ms (*) | 34.9 ms (-22%)
tuple(range(10**6)) | 104 ms (*) | 92.5 ms (-11%)
tuple(map(str, range(10**6))) | 105 ms (*) | 90.5 ms (-14%)
------------------------------+-------------+---------------
Total | 431 ms (*) | 369 ms (-14%)
------------------------------+-------------+---------------
----------
Added file: http://bugs.python.org/file32692/tuple_repr_writer.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19513>
_______________________________________
More information about the Python-bugs-list
mailing list