A.M. Kuchling li...@amk.ca added the comment:
Should this patch just be rejected, then? Or is the more general locking
suggested in msg88021 of interest?
--
nosy: +akuchling
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4174
Mark Dickinson dicki...@gmail.com added the comment:
I agree that the performance improvement isn't worth the extra code, or the
risk of introducing bugs (the comments so far show that it's not trivial to get
this right).
Closing as rejected.
--
nosy: +mark.dickinson
resolution: -
Antoine Pitrou pit...@free.fr added the comment:
I think the patch should just be rejected. Workloads where min() / max()
performance is a bottleneck have to be very rare.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4174
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Perhaps not.
I had however written a general list locking system, generalizing the
way sort() locks a list for direct manipulation, and rewritten min and
max to be able to use that. Perhaps that approach would be of interest?
Antoine Pitrou pit...@free.fr added the comment:
I am with Raymond here: I don't think the performance improvement would
be worth a significant complification of the code - unless the
improvement is /very/ large.
--
___
Python tracker
Daniel Diniz aja...@gmail.com added the comment:
Given the drawbacks mentioned (and the fact that the current patch would
break when the list mutates under its feet), is this still valid?
--
nosy: +ajaksu2
stage: - test needed
___
Python tracker
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4174
___
___
Python-bugs-list mailing list
Changes by David W. Lambert lamber...@corning.com:
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4174
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert lamber...@corning.com:
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4174
___
___
Python-bugs-list mailing list
Unsubscribe:
Hrvoje Nikšić [EMAIL PROTECTED] added the comment:
Note that the item retrieved by PyList_GET_ITEM must be increffed before
being passed to the function. Otherwise mutating the list can remove
the item from the list and destroy the underlying object, in which case
the current maxitem can refer
New submission from Kristján Valur Jónsson [EMAIL PROTECTED]:
This adds a special case for min() and max() when iterating over lists.
For simple lists of floats, the improvement is some 15% on a windows
machine using release build (non pgo)
--
components: Interpreter Core
files:
Antoine Pitrou [EMAIL PROTECTED] added the comment:
I haven't tried the patch as is but I can spot two problems:
- you should use PyList_CheckExact instead of PyList_Check, because a
list subclass could override __getitem__
- when keyfunc is not NULL, you can't assume that the list size will
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Not that excited about adding this much code for such a small speedup.
Also, the list can change size during iteration so the for-loop needs to
be changed to:
for(i = 1; iPyList_GET_SIZE(v); i++)
--
priority: - low
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Antoine, the list can mutate even when the keyfunc is NULL. The rich
comparison can callback to arbitrary Python code.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4174
Antoine Pitrou [EMAIL PROTECTED] added the comment:
Antoine, the list can mutate even when the keyfunc is NULL. The rich
comparison can callback to arbitrary Python code.
Ouch, you are right.
___
Python tracker [EMAIL PROTECTED]
15 matches
Mail list logo