Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | merge 3.3 | Benjamin Peterson | 2016-01-01 | 1 | -2/+0 |
|\ | |||||
| * | remove some copyright notices supserseded by the toplevel ones | Benjamin Peterson | 2016-01-01 | 1 | -2/+0 |
| | | |||||
* | | Issue #19663: Improve error message for defaultdict. | Raymond Hettinger | 2015-07-20 | 1 | -1/+1 |
| | | |||||
* | | Defer deleted item decref until after the deque is restored to a consistent ↵ | Raymond Hettinger | 2015-05-02 | 1 | -6/+6 |
| | | | | | | | | state. | ||||
* | | merge 3.3 (#20250) | Benjamin Peterson | 2014-01-14 | 1 | -1/+3 |
|\ \ | |/ | |||||
| * | correct defaultdict signature in docstring (closes #20250) | Benjamin Peterson | 2014-01-14 | 1 | -1/+3 |
| | | | | | | | | Patch from Andrew Barnert. | ||||
* | | Issue #19512: _count_elements() of _collections reuses PyId_get identifier | Victor Stinner | 2013-11-06 | 1 | -1/+1 |
| | | | | | | | | instead of literal "get" string | ||||
* | | merge | Raymond Hettinger | 2013-10-04 | 1 | -14/+15 |
|\ \ | |/ | |||||
| * | Issue #18594: Make the C code more closely match the pure python code. | Raymond Hettinger | 2013-10-04 | 1 | -14/+15 |
| | | |||||
* | | merge | Raymond Hettinger | 2013-10-02 | 1 | -18/+23 |
|\ \ | |/ | |||||
| * | Issue #18594: Fix the fallback path in collections.Counter(). | Raymond Hettinger | 2013-10-02 | 1 | -18/+23 |
| | | |||||
* | | merge | Raymond Hettinger | 2013-10-01 | 1 | -1/+15 |
|\ \ | |/ | |||||
| * | Issue #18594: Fix the fast path for collections.Counter(). | Raymond Hettinger | 2013-10-01 | 1 | -1/+15 |
| | | | | | | | | The path wasn't being taken due to an over-restrictive type check. | ||||
| * | Backport deque.rotate() improvements. | Raymond Hettinger | 2013-02-10 | 1 | -19/+73 |
| | | |||||
* | | Restore the data block size to 62. | Raymond Hettinger | 2013-07-28 | 1 | -3/+6 |
| | | | | | | | | | | | | | | | | | | | | | | | | The former block size traded away good fit within cache lines in order to gain faster division in deque_item(). However, compilers are getting smarter and can now replace the slow division operation with a fast integer multiply and right shift. Accordingly, it makes sense to go back to a size that lets blocks neatly fill entire cache-lines. GCC-4.8 and CLANG 4.0 both compute "x // 62" with something roughly equivalent to "x * 9520900167075897609 >> 69". | ||||
* | | Assertions key off NDEBUG | Raymond Hettinger | 2013-07-27 | 1 | -1/+1 |
| | | |||||
* | | Minor code simplification by eliminating an unnecessary temporary variable. | Raymond Hettinger | 2013-07-21 | 1 | -12/+6 |
| | | |||||
* | | Tweak the deque struct by moving the least used fields (maxlen and weakref) ↵ | Raymond Hettinger | 2013-07-14 | 1 | -1/+1 |
| | | | | | | | | to the end. | ||||
* | | Use a do-while loop in the inner loop for rotate (m is always greater than ↵ | Raymond Hettinger | 2013-07-14 | 1 | -2/+6 |
| | | | | | | | | zero). | ||||
* | | Move the freeblock() call outside the main loop to speed-up and simplify the ↵ | Raymond Hettinger | 2013-07-13 | 1 | -9/+15 |
| | | | | | | | | block re-use logic. | ||||
* | | Add a spacing saving heuristic to deque's extend methods | Raymond Hettinger | 2013-07-09 | 1 | -0/+16 |
| | | |||||
* | | Fix #ifdef | Raymond Hettinger | 2013-07-07 | 1 | -1/+1 |
| | | |||||
* | | Use macros for marking and checking endpoints in the doubly-linked list of ↵ | Raymond Hettinger | 2013-07-07 | 1 | -47/+81 |
| | | | | | | | | | | | | | | | | | | | | blocks. * Add comment explaining the endpoint checks * Only do the checks in a debug build * Simplify newblock() to only require a length argument and leave the link updates to the calling code. * Also add comment for the freelisting logic. | ||||
* | | Improve variable names in deque_count() | Raymond Hettinger | 2013-07-07 | 1 | -8/+8 |
| | | |||||
* | | Apply the PyObject_VAR_HEAD and Py_SIZE macros | Raymond Hettinger | 2013-07-06 | 1 | -40/+39 |
| | | | | | | | | to be consistent with practices in other modules. | ||||
* | | Refactor deque_traverse(). | Raymond Hettinger | 2013-07-06 | 1 | -6/+6 |
| | | | | | | | | | | Hoist conditional expression out of the loop. Use rightblock as the guard instead of checking for NULL. | ||||
* | | Remove unnecessary branches from count() and reverse(). | Raymond Hettinger | 2013-07-06 | 1 | -6/+3 |
| | | |||||
* | | Speed-up deque indexing by changing the deque block length to a power of two. | Raymond Hettinger | 2013-07-06 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The division and modulo calculation in deque_item() can be compiled to fast bitwise operations when the BLOCKLEN is a power of two. Timing before: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0627 usec per loop Timing after: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0581 usec per loop | ||||
* | | Misc improvements to collections.deque() | Raymond Hettinger | 2013-06-23 | 1 | -72/+93 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Clarified comment on the impact of BLOCKLEN on deque_index (with a power-of-two, the division and modulo computations are done with a right-shift and bitwise-and). * Clarified comment on the overflow check to note that it is general and not just applicable the 64-bit builds. * In deque._rotate(), the "deque->" indirections are factored-out of the loop (loop invariant code motion), leaving the code cleaner looking and slightly faster. * In deque._rotate(), replaced the memcpy() with an equivalent loop. That saved the memcpy setup time and allowed the pointers to move in their natural leftward and rightward directions. See comparative timings at: http://pastebin.com/p0RJnT5N | ||||
* | | Minor tweaks to varnames, declarations, and comments. | Raymond Hettinger | 2013-02-07 | 1 | -8/+7 |
| | | |||||
* | | Minor variable access clean-ups for deque.rotate(). | Raymond Hettinger | 2013-02-05 | 1 | -13/+13 |
| | | |||||
* | | Minor edits: Tighten-up the halflen logic and touch-up the assertions and ↵ | Raymond Hettinger | 2013-02-04 | 1 | -10/+6 |
| | | | | | | | | comments. | ||||
* | | Issue 16398: One more assertion for good measure. | Raymond Hettinger | 2013-02-02 | 1 | -0/+2 |
| | | |||||
* | | Issue 16398: Add assertions to show why memcmp is safe. | Raymond Hettinger | 2013-02-02 | 1 | -1/+4 |
| | | |||||
* | | Issue 16398: Use memcpy() in deque.rotate(). | Raymond Hettinger | 2013-02-02 | 1 | -50/+60 |
| | | |||||
* | | merge 3.3 | Benjamin Peterson | 2013-01-13 | 1 | -6/+2 |
|\ \ | |/ | |||||
| * | make deque_clear void, since it's infallible | Benjamin Peterson | 2013-01-13 | 1 | -6/+2 |
| | | |||||
* | | Issue #16398: Optimize deque.rotate() | Raymond Hettinger | 2013-01-12 | 1 | -14/+58 |
|/ | |||||
* | Merge: fix docstring for deque ctor to mark iterable parameter optional | Andrew Svetlov | 2012-10-31 | 1 | -1/+1 |
|\ | |||||
| * | Fix docstring for deque ctor to mark iterable parameter optional | Andrew Svetlov | 2012-10-31 | 1 | -1/+1 |
| | | |||||
* | | MERGE: Closes #15469: Correct __sizeof__ support for deque | Jesus Cea | 2012-08-03 | 1 | -1/+20 |
|\ \ | |/ | |||||
| * | Closes #15469: Correct __sizeof__ support for deque | Jesus Cea | 2012-08-03 | 1 | -1/+20 |
| | | |||||
* | | Issue #14288: Serialization support for builtin iterators. | Kristján Valur Jónsson | 2012-04-03 | 1 | -2/+91 |
| | | |||||
* | | Issue #13015: Fix a possible reference leak in defaultdict.__repr__. | Antoine Pitrou | 2012-02-15 | 1 | -1/+3 |
|\ \ | |/ | | | | | Patch by Suman Saha. | ||||
| * | Issue #13015: Fix a possible reference leak in defaultdict.__repr__. | Antoine Pitrou | 2012-02-15 | 1 | -1/+3 |
| | | | | | | | | Patch by Suman Saha. | ||||
* | | Rename _Py_identifier to _Py_IDENTIFIER. | Martin v. Löwis | 2011-10-14 | 1 | -2/+2 |
| | | |||||
* | | Use identifier API for PyObject_GetAttrString. | Martin v. Löwis | 2011-10-10 | 1 | -1/+2 |
| | | |||||
* | | Add API for static strings, primarily good for identifiers. | Martin v. Löwis | 2011-10-09 | 1 | -1/+3 |
| | | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing. | ||||
* | | Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED. | Brian Curtin | 2011-08-11 | 1 | -2/+1 |
| | | | | | | | | The macro was introduced in #12724. | ||||
* | | Simplify _count_elements() in _collections | Victor Stinner | 2011-04-20 | 1 | -12/+4 |
|/ | | | | PyIter_Next() cannot return a PyExc_StopIteration: it clears this exception. |