Add memory consumption table.

This commit is contained in:
Martin v. Löwis 2011-08-28 20:12:38 +02:00
parent 81e415ac36
commit de53c32064
1 changed files with 36 additions and 0 deletions

View File

@ -226,6 +226,42 @@ discouraged, or scheduled for removal. This is not the intent of this
PEP; applications that use them will see a performance penalty,
though. Future versions of Python may consider to remove them.
Performance
-----------
Performance of this patch must be considered for both memory
consumption and runtime efficiency. For memory consumption, the
expectation is that applications that have many large strings will see
a reduction in memory usage. For small strings, the effects depend on
the pointer size of the system, and the size of the Py_UNICODE/wchar_t
type. The following table demonstrates this for various small string
sizes and platforms.
+-------+---------------------------------+----------------+
|string | Python 3.2 | This PEP |
|size +----------------+----------------+ |
| | 16-bit wchar_t | 32-bit wchar_t | |
| +---------+------+--------+-------+--------+-------+
| | 32-bit |64-bit| 32-bit |64-bit | 32-bit |64-bit |
+-------+---------+------+--------+-------+--------+-------+
|1 | 40 | 64 | 40 | 64 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|2 | 40 | 64 | 48 | 72 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|3 | 40 | 64 | 48 | 72 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|4 | 48 | 72 | 56 | 80 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|5 | 48 | 72 | 56 | 80 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|6 | 48 | 72 | 64 | 88 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|7 | 48 | 72 | 64 | 88 | 48 | 88 |
+-------+---------+------+--------+-------+--------+-------+
|8 | 56 | 80 | 72 | 96 | 56 | 88 |
+-------+---------+------+--------+-------+--------+-------+
Copyright
=========