[issue7782] new test for test_iter.py

2010-03-23 Thread showell
showell added the comment: My proposed test is final. Please either accept or reject it as is. I assume it runs pretty quickly, so I am not sure what the cost fear is. The benefit of accepting the test is that it would potentially catch bugs on changes to the implementation of list

[issue7770] sin/cos function in decimal-docs

2010-01-29 Thread showell
showell added the comment: +1 on showing off remainder_near. I recently wrote a program where I reinvented the logic (on a unit circle too), not knowing it was already implemented in Decimal. -- nosy: +Steve Howell ___ Python tracker <h

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell
showell added the comment: I am closing this due to mostly unanimous rejection on python-dev. If folks reopen this in the future, the last patch that I submitted has been reasonably well tested, but it has not been code reviewed. The 1% speed penalty could probably be driven down without too

[issue7782] new test for test_iter.py

2010-01-29 Thread showell
showell added the comment: Per Ezio's suggestions, I added clearer comments and an assert, and now the attached diff applies to trunk. -- keywords: +patch Added file: http://bugs.python.org/file16037/extend_test.diff ___ Python tracker

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell
Changes by showell : Removed file: http://bugs.python.org/file16033/list_top_no_extra_mem.diff ___ Python tracker <http://bugs.python.org/issue7784> ___ ___ Python-bug

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell
showell added the comment: Ok, found the offending line, now all tests pass. The use case where this patch will pay off the most is slicing your way through a list of tasks. The toy program below gets about a 50x speedup. import time n = 80 lst

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell
showell added the comment: I am attaching a new patch that does not add a new element to PyListObject, roughly following a technique that Antoine Pitrou suggested on python-dev. When I want to lazily avoid a memmove under the new patch, I set the MSB on allocated and store the original

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-27 Thread showell
showell added the comment: I will attempt to fix insert(0, pop) in the next patch I submit (using pointer vs. orphans count). Just so we are clear on the performance that I'm promising, I expect benchmarks to prove out these facts: 1) New-list will always perform comparably to old

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-26 Thread showell
showell added the comment: The next stage for the patch is that I need to switch from using orphans count to using ob_allocated pointer. -- ___ Python tracker <http://bugs.python.org/issue7

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-26 Thread showell
showell added the comment: --- On Tue, 1/26/10, Florent Xicluna wrote: > From: Florent Xicluna > Subject: [issue7784] patch for making list/insert at the top of the list > avoid memmoves > To: showel...@yahoo.com > Date: Tuesday, January 26, 2010, 3:53 AM > > Florent

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-26 Thread showell
New submission from showell : I am attaching a patch to improve the performance of list operations that insert or delete elements at the front of the list. The patch has had some discussion on python-dev in the thread entitled "patch to make list.pop(0) work in O(1) time."

[issue7782] new test for test_iter.py

2010-01-26 Thread showell
New submission from showell : I would like to submit the following test to be part of the test_iter.py test suite: def test_extends(self): # This test would break on an incomplete patch to listobject.c def gen(): for i in range(500): yield i