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 pitrou, serhiy.storchaka, tim.peters, vstinner
Date 2013-11-18.09:28:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384766893.99.0.44471250119.issue19581@psf.upfronthosting.co.za>
In-reply-to
Content
> Your patch implies that the two only supported OSes are Linux and Windows :-)

It more means that Windows memory allocator is different to the one used on all other operating systems.

Well, if you are not convinced, we can keep the overallocation factor of 25%: performances are not so bad. The difference between 25% and 50% is low.

--

Benchmark on patched repr(list) (to use PyUnicodeWriter, see issue #19513) using different overallocation factors on Linux. The best factor is 25% (the current factor).


Platform: Linux-3.9.4-200.fc18.x86_64-x86_64-with-fedora-18-Spherical_Cow
Bits: int=32, long=64, long long=64, size_t=64, void*=64
Timer: time.perf_counter
SCM: hg revision=00348c0518f8+ tag=tip branch=default date="2013-11-18 10:04 +0100"
Python unicode implementation: PEP 393
CFLAGS: -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
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)
Python version: 3.4.0a4+ (default:00348c0518f8+, Nov 18 2013, 10:11:42) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)]
Timer precision: 40 ns

-----------------------------+-------------+----------------+----------------+--------------
Tests                        |   writer-25 |    writer-12.5 |      writer-50 |    writer-100
-----------------------------+-------------+----------------+----------------+--------------
list("a")                    |  247 ns (*) |  272 ns (+10%) |   265 ns (+7%) | 283 ns (+14%)
list("abc")                  |  435 ns (*) |   407 ns (-7%) |         430 ns |        427 ns
["a"]*(100)                  | 8.26 us (*) |         8.4 us |  8.76 us (+6%) |       7.93 us
["abc"]*(100)                | 7.97 us (*) | 8.75 us (+10%) | 9.19 us (+15%) |       8.37 us
["a" * 100]*(100)            | 35.7 us (*) |        36.8 us |        36.6 us |       35.6 us
["a"]*(10**6)                |   73 ms (*) |  77.4 ms (+6%) | 84.9 ms (+16%) | 78.3 ms (+7%)
["abc"]*(10**6)              | 76.6 ms (*) |  81.1 ms (+6%) | 90.3 ms (+18%) | 82.4 ms (+8%)
["a" * 100]*(10**5)          | 35.1 ms (*) |        35.3 ms |        35.8 ms | 37.6 ms (+7%)
list(range(10**6))           | 93.4 ms (*) |  102 ms (+10%) |  103 ms (+10%) | 105 ms (+12%)
list(map(str, range(10**6))) |   97 ms (*) |        94.1 ms |        99.7 ms | 91.2 ms (-6%)
-----------------------------+-------------+----------------+----------------+--------------
Total                        |  375 ms (*) |         390 ms |  414 ms (+10%) |  394 ms (+5%)
-----------------------------+-------------+----------------+----------------+--------------
History
Date User Action Args
2013-11-18 09:28:14vstinnersetrecipients: + vstinner, tim.peters, pitrou, serhiy.storchaka
2013-11-18 09:28:13vstinnersetmessageid: <1384766893.99.0.44471250119.issue19581@psf.upfronthosting.co.za>
2013-11-18 09:28:13vstinnerlinkissue19581 messages
2013-11-18 09:28:12vstinnercreate