summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue 18771: Make it possible to set the number linear probes at compile-time.Raymond Hettinger2013-09-151-5/+19
|
* Put the defines in the logical section and fix indentation.Raymond Hettinger2013-09-081-8/+8
|
* Minor code beautification.Raymond Hettinger2013-09-081-6/+5
|
* Improve code clarity by removing two unattractive macros.Raymond Hettinger2013-09-081-16/+18
|
* Remove the freelist scheme for setobjects.Raymond Hettinger2013-09-082-48/+8
| | | | | | | | | The setobject freelist was consuming memory but not providing much value. Even when a freelisted setobject was available, most of the setobject fields still needed to be initialized and the small table still required a memset(). This meant that the custom freelisting scheme for sets was providing almost no incremental benefit over the default Python freelist scheme used by _PyObject_Malloc() in Objects/obmalloc.c.
* Small rearrangement to bring together the three functions for probing the ↵Raymond Hettinger2013-09-081-32/+39
| | | | hash table.
* Move the overview comment to the top of the file.Raymond Hettinger2013-09-071-22/+20
|
* Nerge 3.3 into default.Tim Peters2013-09-061-1/+1
|\ | | | | | | | | | | | | | | Issue #18942: sys._debugmallocstats() output was damaged on Windows. _PyDebugAllocatorStats() called PyOS_snprintf() with a %zd format code, but MS doesn't support that code. Interpolated PY_FORMAT_SIZE_T in place of the "z".
| * Issue #18942: sys._debugmallocstats() output was damaged on Windows.Tim Peters2013-09-061-1/+1
| | | | | | | | | | | | _PyDebugAllocatorStats() called PyOS_snprintf() with a %zd format code, but MS doesn't support that code. Interpolated PY_FORMAT_SIZE_T in place of the "z".
* | Minor touchups.Raymond Hettinger2013-09-021-4/+6
| |
* | Factor-out the common code for setting a KeyError.Raymond Hettinger2013-09-022-33/+5
| |
* | Instead of XORed indicies, switch to a hybrid of linear probing and open ↵Raymond Hettinger2013-09-021-91/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | addressing. Modern processors tend to make consecutive memory accesses cheaper than random probes into memory. Small sets can fit into L1 cache, so they get less benefit. But they do come out ahead because the consecutive probes don't probe the same key more than once and because the randomization step occurs less frequently (or not at all). For the open addressing step, putting the perturb shift before the index calculation gets the upper bits into play sooner.
* | Update copyright.Raymond Hettinger2013-09-011-1/+1
| |
* | Further reduce the cost of hash collisions by inspecting an additional ↵Raymond Hettinger2013-09-011-4/+39
| | | | | | | | nearby entry.
* | Close #18780: %-formatting now prints value for int subclasses with %d, %i, ↵Ethan Furman2013-08-311-5/+3
| | | | | | | | and %u codes.
* | Tighten-up the lookkey() logic and beautify the code a bit.Raymond Hettinger2013-08-291-88/+43
| | | | | | | | | | | | | | Use less code by moving many of the steps from the initial lookup into the main search loop. Beautify the code but keep the overall logic unchanged.
* | Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-275-61/+60
|\ \ | |/ | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-275-61/+60
| | | | | | | | error messages and comments.
* | Restore changeset 5bd9db528aed (issue #18408)Victor Stinner2013-08-262-0/+22
| | | | | | | | | | | | | | | | "Issue #18408: PyObject_Str(), PyObject_Repr() and type_call() now fail with an assertion error if they are called with an exception set (PyErr_Occurred()). As PyEval_EvalFrameEx(), they may clear the current exception and so the caller looses its exception."
* | Issue #18408: _PyObject_Dump() now saves/restores the current exceptionVictor Stinner2013-08-261-0/+6
| | | | | | | | So it can be called even if an exception was raised
* | Various clarifications based on feedback & questions over the years.Tim Peters2013-08-241-19/+96
|\ \ | |/
| * Various clarifications based on feedback & questions over the years.Tim Peters2013-08-241-19/+96
| | | | | | | | (grafted from 23181bf411a16287a0a54e910fc0f9ecd2764bf0)
* | Issue #18772: fix the gdb plugin after the set implementation changesAntoine Pitrou2013-08-242-9/+3
| |
* | Back out 5bd9db528aed (issue #18408). It caused unsolved buildbot failures.Antoine Pitrou2013-08-232-23/+0
| |
* | Add the same dummy type that is used in dictionaries.Raymond Hettinger2013-08-231-15/+49
| |
* | Add line explaining the "%sort" test.Tim Peters2013-08-221-0/+1
|\ \ | |/
| * Add line explaining the "%sort" test.Tim Peters2013-08-221-0/+1
| | | | | | | | (grafted from 1ea833ecaf5a9d43a886e9e73b4e2551d0d5b548)
* | Issue 18797: Remove unneeded refcount adjustments for dummy objects.Raymond Hettinger2013-08-221-16/+6
| | | | | | | | It suffices to keep just one reference when the object is created.
* | Hoist the global dummy lookup out of the inner loop for set_merge().Raymond Hettinger2013-08-211-1/+3
| |
* | Remove a redundant hash table probe (this was artifact from an earlier draft ↵Raymond Hettinger2013-08-211-11/+0
| | | | | | | | of the patch).
* | Issue 18772: Restore set dummy object back to unicode and restore the ↵Raymond Hettinger2013-08-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | identity checks in lookkey(). The Gdb prettyprint plugin depended on the dummy object being displayable. Other solutions besides a unicode object are possible. For now, get it back up and running. The identity checks in lookkey() need to be there to prevent the dummy object from leaking through Py_RichCompareBool() into user code in the rare circumstance where the dummy's hash value exactly matches the hash value of the actual key being looked up.
* | Issue18771: Reduce the cost of hash collisions for set objects.Raymond Hettinger2013-08-191-20/+86
| |
* | Remove the else-clause because the conditions are no longer mutually exclusive.Raymond Hettinger2013-08-171-1/+1
| |
* | Use a known unique object for the dummy entry.Raymond Hettinger2013-08-171-25/+20
| | | | | | | | | | This lets us run PyObject_RichCompareBool() without first needing to check whether the entry is a dummy.
* | Issue #18701: Remove support of old CPython versions (<3.0) from C code.Serhiy Storchaka2013-08-161-5/+0
| |
* | Hoist the global "dummy" lookup outside of the reinsertion loop.Raymond Hettinger2013-08-151-1/+3
| |
* | mergeRaymond Hettinger2013-08-141-9/+0
|\ \ | |/
| * Issue 18719: Remove a false optimizationRaymond Hettinger2013-08-141-9/+0
| | | | | | | | | | | | | | | | | | | | Remove an unused early-out test from the critical path for dict and set lookups. When the strings already have matching lengths, kinds, and hashes, there is no additional information gained by checking the first characters (the probability of a mismatch is already known to be less than 1 in 2**64).
| * Silence compiler warning for an unused declarationRaymond Hettinger2013-08-041-1/+0
| |
* | Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou2013-08-1320-196/+196
| |
* | Replace outdated optimization with clearer code that compiles better.Raymond Hettinger2013-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Letting the compiler decide how to optimize the multiply by five gives it the freedom to make better choices for the best technique for a given target machine. For example, GCC on x86_64 produces a little bit better code: Old-way (3 steps with a data dependency between each step): shrq $5, %r13 leaq 1(%rbx,%r13), %rax leaq (%rax,%rbx,4), %rbx New-way (3 steps with no dependency between the first two steps which can be run in parallel): leaq (%rbx,%rbx,4), %rax # i*5 shrq $5, %r13 # perturb >>= PERTURB_SHIFT leaq 1(%r13,%rax), %rbx # 1 + perturb + i*5
* | Issue #17934: Add a clear() method to frame objects, to help clean up ↵Antoine Pitrou2013-08-052-5/+31
| | | | | | | | expensive details (local variables) and break reference cycles.
* | mergeRaymond Hettinger2013-08-041-1/+1
|\ \ | |/
| * Silence compiler warning about an uninitialized variableRaymond Hettinger2013-08-041-1/+1
| |
* | Issue #16741: Fix an error reporting in int().Serhiy Storchaka2013-08-032-52/+64
|\ \ | |/
| * Issue #16741: Fix an error reporting in int().Serhiy Storchaka2013-08-032-51/+67
| |
* | Minor consistency fixes for some longobject.c exception messages:Mark Dickinson2013-08-031-4/+4
| | | | | | | | | | | | - replace 'long int' / 'long' by 'int' - fix capitalization of "Python" in PyLong_AsUnsignedLong - "is too large" -> "too large", for consistency with other messages.
* | Issue #18214: Improve finalization of Python modules to avoid setting their ↵Antoine Pitrou2013-07-311-8/+21
| | | | | | | | globals to None, in most cases.
* | Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-303-123/+147
| |
* | Issue #18520: Fix _PyDict_GetItemId(), suppress _PyUnicode_FromId() errorVictor Stinner2013-07-221-1/+3
| | | | | | | | | | As PyDict_GetItem(), _PyDict_GetItemId() suppresses all errors that may occur, for historical reasons.