From bb0d67250e24d3d1cf727c78e47b41d5c113aa69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 5 Mar 2012 07:58:30 +0100 Subject: [PATCH] Incorporate measurement results. --- pep-0393.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pep-0393.txt b/pep-0393.txt index b53e572df..911bca3c6 100644 --- a/pep-0393.txt +++ b/pep-0393.txt @@ -372,6 +372,25 @@ the iobench, stringbench, and json benchmarks see typically slowdowns of 1% to 30%; for specific benchmarks, speedups may happen as may happen significantly larger slowdowns. +In actual measurements of a Django application ([2]_), significant +reductions of memory usage could be found. For example, the storage +for Unicode objects reduced to 2216807 bytes, down from 6378540 bytes +for a wide Unicode build, and down from 3694694 bytes for a narrow +Unicode build (all on a 32-bit system). This reduction came from the +prevalence of ASCII strings in this application; out of 36,000 strings +(with 1,310,000 chars), 35713 where ASCII strings (with 1,300,000 +chars). The sources for these strings where not further analysed; +many of them likely originate from identifiers in the library, and +string constants in Django's source code. + +In comparison to Python 2, both Unicode and byte strings need to be +accounted. In the test application, Unicode and byte strings combined +had a length of 2,046,000 units (bytes/chars) in 2.x, and 2,200,000 +units in 3.x. On a 32-bit system, where the 2.x build used 32-bit +wchar_t/Py_UNICODE, the 2.x test used 3,620,000 bytes, and the 3.x +build 3,340,000 bytes. This reduction in 3.x using the PEP compared +to 2.x only occurs when comparing with a wide unicode build. + Porting Guidelines ================== @@ -435,6 +454,8 @@ References .. [1] PEP 393 branch https://bitbucket.org/t0rsten/pep-393 +.. [2] Django measurement results + http://www.dcl.hpi.uni-potsdam.de/home/loewis/djmemprof/ Copyright =========