summaryrefslogtreecommitdiff
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Reduce load factor (from 66% to 60%) to improve effectiveness of linear probing.Raymond Hettinger2017-02-041-3/+3
| | | | | | | Decreased density gives better collision statistics (average of 2.5 probes in a full table versus 3.0 previously) and fewer occurences of starting a second possibly overlapping sequence of 10 linear probes. Makes resizes a little more frequent but each with less work (fewer insertions and fewer collisions).
* Issue #29311: Regenerate Argument Clinic.Serhiy Storchaka2017-02-042-3/+3
|
* Issue #29263: LOAD_METHOD support for C methodsINADA Naoki2017-02-033-25/+70
| | | | Calling builtin method is at most 10% faster.
* Remove unnecessary variables.Raymond Hettinger2017-02-021-5/+2
| | | | | * so->used never gets changed during a resize * so->filled only changes when dummies are present and being eliminated
* Issue #29421: Make int.to_bytes() and int.from_bytes() slightly fasterSerhiy Storchaka2017-02-021-4/+7
| | | | (10-20% for small integers).
* Issue #20185: Converted the int class to Argument Clinic.Serhiy Storchaka2017-02-012-135/+303
| | | | Based on patch by Vajrasky Kok.
* Issue #29383: reduce temporary interned unicodeINADA Naoki2017-01-281-3/+10
| | | | | | | | | | | | | | add_methods(), add_members(), and add_getset() used PyDict_SetItemString() to register descriptor to the type's dict. So descr_new() and PyDict_SetItemString() creates interned unicode from same C string. This patch takes interned unicode from descriptor, and use PyDict_SetItem() instead of PyDict_SetItemString(). python_startup_no_site: default: Median +- std dev: 12.7 ms +- 0.1 ms patched: Median +- std dev: 12.5 ms +- 0.1 ms
* Issue #29358: Add postcondition checks on typesVictor Stinner2017-01-251-3/+24
|
* Issue #27867: Function PySlice_GetIndicesEx() is deprecated and replaced withSerhiy Storchaka2017-01-2536-1821/+3143
|\ | | | | | | | | | | a macro if Py_LIMITED_API is not set or set to the value between 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher. Added functions PySlice_Unpack() and PySlice_AdjustIndices().
| * Issues #29311, #29289: Fixed and improved docstrings for dict and OrderedDictSerhiy Storchaka2017-01-254-34/+36
| | | | | | | | methods.
| * Issue #29337: Fixed possible BytesWarning when compare the code objects.Serhiy Storchaka2017-01-2436-1815/+3135
| |\ | | | | | | | | | Warnings could be emitted at compile time.
| | * Issue #29360: _PyStack_AsDict() doesn't check kwnamesVictor Stinner2017-01-241-2/+1
| | | | | | | | | | | | | | | Remove two assertions which can fail on legit code. Keyword arguments are checked later with better tests and raise a regular (TypeError) exception.
| | * Fix grammar in doc string, RST markupMartin Panter2017-01-242-4/+4
| | |
| | * Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-4/+2
| | | | | | | | | | | | possible but Coccinelle couldn't find opportunity.
| | * Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-239-51/+25
| | | | | | | | | | | | possible. Patch is writen with Coccinelle.
| | * Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()Serhiy Storchaka2017-01-222-6/+6
| | | | | | | | | | | | is now of type "const char *" rather of "char *".
| | * Issue #29331: Simplified argument parsing in sorted() and list.sort().Serhiy Storchaka2017-01-211-15/+15
| | |
| | * Issue #29289: Argument Clinic generates reasonable name for the parameter ↵Serhiy Storchaka2017-01-192-14/+14
| | | | | | | | | | | | "default".
| | * Issue #29311: Argument Clinic generates reasonable name for the parameter ↵Serhiy Storchaka2017-01-192-17/+19
| | | | | | | | | | | | "default".
| | * Issue #20186: Converted builtins enumerate() and reversed() to Argument Clinic.Serhiy Storchaka2017-01-192-39/+121
| | | | | | | | | | | | Patch by Tal Einat.
| | * Add a note explaining why dict_update() doesn't use METH_FASTCALLVictor Stinner2017-01-191-0/+3
| | | | | | | | | | | | Issue #29312.
| | * dict.get() and dict.setdefault() now use ACVictor Stinner2017-01-192-25/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29311: dict.get() and dict.setdefault() methods now use Argument Clinic to parse arguments. Their calling convention changes from METH_VARARGS to METH_FASTCALL which avoids the creation of a temporary tuple. The signature of docstrings is also enhanced. For example, get(...) becomes: get(self, key, default=None, /)
| | * _PyStack_AsDict() now checks kwnames != NULLVictor Stinner2017-01-181-1/+3
| | | | | | | | | | | | Issue #29259.
| | * Cleanup _PyMethodDef_RawFastCallDict()Victor Stinner2017-01-181-11/+9
| | | | | | | | | | | | | | | | | | Issue #29259: use a different case for METH_VARARGS and METH_VARARGS|METH_KEYWORDS to avoid testing again flags to decide if keywords should be checked or not.
| | * Rephrase !PyErr_Occurred() comment: may=>canVictor Stinner2017-01-184-6/+6
| | | | | | | | | | | | Issue #29259.
| | * _PyObject_FastCallKeywords() now checks !PyErr_Occurred()Victor Stinner2017-01-181-0/+5
| | | | | | | | | | | | | | | Issue #29259. All other functions calling functions start with the similar assertion.
| | * PyCFunction_Call() now calls _PyCFunction_FastCallDict()Victor Stinner2017-01-181-70/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29259. We had 3 versions of similar code: * PyCFunction_Call() * _PyCFunction_FastCallDict() * _PyCFunction_FastCallKeywords() PyCFunction_Call() now calls _PyCFunction_FastCallDict() to factorize the code.
| | * Fix _PyMethodDef_RawFastCallDict() argument parsingVictor Stinner2017-01-181-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29259: * Move also the !PyErr_Occurred() assertion to the top, similar to other functions. * Fix also comment/error messages: the function was renamed to _PyMethodDef_RawFastCallDict()
| | * _PyObject_FastCallKeywords() now checks the resultVictor Stinner2017-01-181-0/+2
| | | | | | | | | | | | Issue ##27830, Issue #29259.
| | * Optimize methoddescr_call(): avoid temporary PyCFunctionVictor Stinner2017-01-182-26/+33
| | | | | | | | | | | | | | | | | | Issue #29259, #29263. methoddescr_call() creates a PyCFunction object, call it and the destroy it. Add a new _PyMethodDef_RawFastCallDict() method to avoid the temporary PyCFunction object.
| | * Remove unused func parameter of _PyStack_UnpackDict()Victor Stinner2017-01-182-3/+2
| | | | | | | | | | | | Issue #29259.
| | * Convert some OrderedDict methods to Argument ClinicVictor Stinner2017-01-172-87/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29289. Convert methods: * fromkeys() class method * setdefault() * popitem() * move_to_end()
| | * Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-175-37/+77
| | | | | | | | | | | | | | | | | | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
| | * Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-173-39/+87
| | | | | | | | | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using only positional arguments.
| | * _PyStack_UnpackDict() now returns -1 on errorVictor Stinner2017-01-172-9/+11
| | | | | | | | | | | | | | | Issue #29286. Change _PyStack_UnpackDict() prototype to be able to notify of failure when args is NULL.
| | * Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywordsVictor Stinner2017-01-174-16/+16
| | | | | | | | | | | | Issue #29286.
| | * type_prepare() now uses fast call (METH_FASTCALL)Victor Stinner2017-01-161-2/+3
| | |
| | * Add _PyStack_AsTupleSlice() helperVictor Stinner2017-01-161-0/+23
| | |
| | * Optimize _PyCFunction_FastCallKeywords()Victor Stinner2017-01-161-36/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29259: Write fast path in _PyCFunction_FastCallKeywords() for METH_FASTCALL, avoid the creation of a temporary dictionary for keyword arguments. Cleanup also _PyCFunction_FastCallDict(): * Don't dereference func before checking that it's not NULL * Move code to raise the "no keyword argument" exception into a new no_keyword_error label. Update python-gdb.py for the change.
| | * Issue #20180: forgot to update AC output.INADA Naoki2017-01-162-41/+39
| | |
| | * Issue #20180: convert unicode methods to AC.INADA Naoki2017-01-162-409/+1405
| | |
| | * Merge doc fixes from 3.6Martin Panter2017-01-141-1/+1
| | |\
| | * | Issue #1621: Overflow should not be possible in listextend()Martin Panter2017-01-141-0/+3
| | | |
| | * | Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-8/+23
| | |\ \ | | | | | | | | | | | | | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| | * | | Disable _PyStack_AsTuple() inliningVictor Stinner2017-01-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29234: Inlining _PyStack_AsTuple() into callers increases their stack consumption, Disable inlining to optimize the stack consumption. Add _Py_NO_INLINE: use __attribute__((noinline)) of GCC and Clang. It reduces the stack consumption, bytes per call, before => after: test_python_call: 1040 => 976 (-64 B) test_python_getitem: 976 => 912 (-64 B) test_python_iterator: 1120 => 1056 (-64 B) => total: 3136 => 2944 (- 192 B)
| | * | | call_method() now uses _PyObject_FastCall()Victor Stinner2017-01-112-44/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29233: Replace the inefficient _PyObject_VaCallFunctionObjArgs() with _PyObject_FastCall() in call_method() and call_maybe(). Only a few functions call call_method() and call it with a fixed number of arguments. Avoid the complex and expensive _PyObject_VaCallFunctionObjArgs() function, replace it with an array allocated on the stack with the exact number of argumlents. It reduces the stack consumption, bytes per call, before => after: test_python_call: 1168 => 1152 (-16 B) test_python_getitem: 1344 => 1008 (-336 B) test_python_iterator: 1568 => 1232 (-336 B) Remove the _PyObject_VaCallFunctionObjArgs() function which became useless. Rename it to object_vacall() and make it private.
| | * | | Issue #29145: Merge 3.6.Xiang Zhang2017-01-1027-948/+825
| | |\ \ \
| | | * \ \ Merge 3.6INADA Naoki2017-01-062-17/+25
| | | |\ \ \
| | | * | | | Issue #28839: Optimize function_call()Victor Stinner2017-01-031-47/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function_call() now simply calls _PyFunction_FastCallDict(). _PyFunction_FastCallDict() is more efficient: it contains fast paths for the common case (optimized code object and no keyword argument).
| | | * | | | Merge 3.6.Stefan Krah2016-12-3026-901/+819
| | | |\ \ \ \