cpython/Objects
Pablo Galindo 372d705d95
bpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846)
The list() constructor isn't taking full advantage of known input
lengths or length hints. This commit makes the constructor
pre-size and not over-allocate when the input size is known (the
input collection implements __len__). One on the main advantages is
that this provides 12% difference in memory savings due to the difference
between overallocating and allocating exactly the input size.

For efficiency purposes and to avoid a performance regression for small
generators and collections, the size of the input object is calculated using
__len__ and not __length_hint__, as the later is considerably slower.
2018-10-28 20:16:26 +00:00
..
clinic Add missing closing quote and trailing period in str.isidentifier() docstring (GH-9756) 2018-10-08 16:14:47 +05:30
stringlib bpo-34523: Support surrogatepass in locale codecs (GH-8995) 2018-08-29 22:21:32 +02:00
README Issue #18093: Factor out the programs that embed the runtime 2014-07-25 21:52:14 +10:00
abstract.c closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935) 2018-08-25 16:52:27 -07:00
accu.c Replace KB unit with KiB (#4293) 2017-11-08 14:44:44 -08:00
boolobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
bytearrayobject.c bpo-34984: Improve error messages for bytes and bytearray constructors. (GH-9874) 2018-10-21 15:29:12 +03:00
bytes_methods.c closes bpo-34599: Improve performance of _Py_bytes_capitalize(). (GH-9083) 2018-09-06 21:54:49 -07:00
bytesobject.c bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ (GH-10152) 2018-10-28 15:02:17 +00:00
call.c Fix issue 34551 - remove redundant store (#9009) 2018-10-22 16:52:46 +01:00
capsule.c Issue #2443: Added a new macro, Py_VA_COPY, which is equivalent to C99 2010-08-11 17:31:17 +00:00
cellobject.c bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
classobject.c bpo-35059: Convert PyObject_INIT() to function (GH-10077) 2018-10-26 14:35:00 +02:00
codeobject.c bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592) 2018-08-03 15:33:52 +02:00
complexobject.c bpo-35059: Convert PyObject_INIT() to function (GH-10077) 2018-10-26 14:35:00 +02:00
descrobject.c bpo-30156: Remove property_descr_get() optimization (GH-9541) 2018-10-01 03:03:22 -07:00
dict-common.h bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) 2018-04-19 22:41:19 -07:00
dictnotes.txt Issue #15055: update dictnotes.txt. Patch by Mark Shannon. 2012-06-24 21:03:45 +02:00
dictobject.c bpo-9263: _PyXXX_CheckConsistency() use _PyObject_ASSERT() (GH-10108) 2018-10-26 18:47:15 +02:00
enumobject.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00
exceptions.c bpo-34940: Fix the error handling in _check_for_legacy_statements(). (GH-9764) 2018-10-12 11:20:59 +03:00
fileobject.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00
floatobject.c bpo-35059: Convert PyObject_INIT() to function (GH-10077) 2018-10-26 14:35:00 +02:00
frameobject.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00
funcobject.c bpo-33418: Add tp_clear for function object (GH-8058) 2018-07-04 11:15:50 +09:00
genobject.c closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin() (GH-8911) 2018-08-25 00:15:23 -07:00
iterobject.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00
listobject.c bpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846) 2018-10-28 20:16:26 +00:00
listsort.txt bpo-28685: Optimize sorted() list.sort() with type-specialized comparisons (#582) 2018-01-28 19:03:23 -08:00
lnotab_notes.txt bpo-28810: Update lnotab_notes.txt (#665) 2017-03-14 21:42:09 +02:00
longobject.c bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ (GH-10152) 2018-10-28 15:02:17 +00:00
memoryobject.c bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466) 2018-04-14 19:49:21 +02:00
methodobject.c bpo-35059: Convert PyObject_INIT() to function (GH-10077) 2018-10-26 14:35:00 +02:00
moduleobject.c Fix misleading mentions of tp_size in comments (GH-9093) 2018-09-10 09:46:08 -07:00
namespaceobject.c Fix misleading mentions of tp_size in comments (GH-9093) 2018-09-10 09:46:08 -07:00
object.c bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ (GH-10152) 2018-10-28 15:02:17 +00:00
obmalloc.c bpo-35053: Enhance tracemalloc to trace free lists (GH-10063) 2018-10-25 13:31:16 +02:00
odictobject.c bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. (GH-9051) 2018-10-20 08:20:39 +03:00
rangeobject.c closes bpo-34468: Objects/rangeobject.c: Fix an always-false condition in range_repr() (GH-8880) 2018-08-23 21:39:45 -07:00
setobject.c bpo-34573: Simplify __reduce__() of set and dict iterators. (GH-9050) 2018-10-20 01:43:33 +01:00
sliceobject.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00
structseq.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00
tupleobject.c bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ (GH-10152) 2018-10-28 15:02:17 +00:00
typeobject.c bpo-9263: _PyXXX_CheckConsistency() use _PyObject_ASSERT() (GH-10108) 2018-10-26 18:47:15 +02:00
typeslots.inc add Py_tp_finalize slot (closes #24345) 2015-06-01 10:12:48 -05:00
typeslots.py Issue #26662: Set PYTHON_FOR_GEN in configure 2016-07-26 12:48:08 +02:00
unicodectype.c Removed unintentional trailing spaces in non-external and non-generated C files. 2015-03-18 21:53:15 +02:00
unicodeobject.c bpo-9263: _PyXXX_CheckConsistency() use _PyObject_ASSERT() (GH-10108) 2018-10-26 18:47:15 +02:00
unicodetype_db.h update to Unicode 11.0.0 (closes bpo-33778) (GH-7439) 2018-06-06 20:14:28 -07:00
weakrefobject.c bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) 2018-04-29 21:59:33 +03:00

README

Source files for various builtin objects