[issue4074] Building a list of tuples has non-linear performance

2009-01-09 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Ok, committed in trunk and py3k. Thanks! Thanks! ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4074] Building a list of tuples has non-linear performance

2009-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, committed in trunk and py3k. Thanks! -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue4074] Building a list of tuples has non-linear performance

2009-01-09 Thread Collin Winter
Collin Winter added the comment: LGTM. Go ahead and commit this. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue4074] Building a list of tuples has non-linear performance

2009-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch with updated comments. Added file: http://bugs.python.org/file12670/gctrigger6.patch ___ Python tracker ___ __

[issue4074] Building a list of tuples has non-linear performance

2009-01-08 Thread Collin Winter
Collin Winter added the comment: Looking at gctrigger5.patch, my only thought is that it would be helpful for posterity to include more verbose comments about why this new behaviour was chosen; chunks of Martin's proposal from the referenced python-dev thread could be included verbatim. Othe

[issue4074] Building a list of tuples has non-linear performance

2008-12-30 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: The optimization issue for tuples and dicts is #4688. ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Cleanup: this patch only has the algorithmic change. Tuple and dict opts will go to a separate tracker issue. Added file: http://bugs.python.org/file12386/gctrigger5.patch ___ Python tracker

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12380/gctrigger4.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12379/gctrigger3.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12378/gctrigger2.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12353/gctrigger.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12383/dictopts.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Now an additional patch which applies over the basic gctrigger4.patch. It adds dict optimizations so that dicts with only atomic or immutable elements are also untracked (they get tracked later when other trackable elements are added). Since dicts are often use

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: New version of Greg's script, with different choices (list of tuples, list of lists, list of dicts, dict of tuples). Added file: http://bugs.python.org/file12382/tuple_gc_hell.py ___ Python tracker

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file11743/tuple_gc_hell.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: FWIW, with the tuple optimization, the number of objects in gc.get_objects() after the regression tests has fallen from 15 to 14. ___ Python tracker

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a new patch adding tests for gc.is_tracked(). Added file: http://bugs.python.org/file12380/gctrigger4.patch ___ Python tracker ___ _

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: This new patch also adds a function named gc.is_tracked() which returns True if the object is tracked by the GC: >>> import gc >>> gc.is_tracked(1) False >>> gc.is_tracked([]) True >>> gc.is_tracked(()) True >>> gc.is_tracked((0,1)) False >>> gc.is_tracked((0,"

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: This new patch adds another improvement where tuples can be "optimized". Optimized means that tuples which don't contain any GC-tracked object become themselves untracked. Since tuples are immutable this optimization is valid, and since it is common to store lot

[issue4074] Building a list of tuples has non-linear performance

2008-12-16 Thread Collin Winter
Changes by Collin Winter : -- nosy: +collinwinter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue4074] Building a list of tuples has non-linear performance

2008-12-14 Thread Adam Olsen
Adam Olsen added the comment: I didn't test it, but the patch looks okay to me. -- nosy: +Rhamphoryncus ___ Python tracker ___ ___ Pyt

[issue4074] Building a list of tuples has non-linear performance

2008-12-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a simple patch implementing Martin's proposal with a few basic tweaks. Using Greg's script, we get: -> without patch: 100 2.64134001732 200 3.60712885857 300 5.40855813026 400 6.46308898926 500 8.65147781372 600 10.3949871063 7

[issue4074] Building a list of tuples has non-linear performance

2008-10-09 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Someone should try implementing Martin's suggestion one day :) -- nosy: +pitrou versions: +Python 3.1 -Python 2.5, Python 2.6 ___ Python tracker <[EMAIL PROTECTED]>

[issue4074] Building a list of tuples has non-linear performance

2008-10-07 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: This is a known problem; see the GC discussions in June for an example, e.g. http://mail.python.org/pipermail/python-dev/2008-June/080579.html -- nosy: +loewis ___ Python tracker <[EMAIL PROTECTE

[issue4074] Building a list of tuples has non-linear performance

2008-10-07 Thread Gregory P. Smith
New submission from Gregory P. Smith <[EMAIL PROTECTED]>: The attached script simply loops building a list of tuples. It has horrible performance as the list gets larger compared to something appending simple objects like ints to the list. % python tuple_gc_hell.py ~ ... 10