Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

Zeroing memory is usually not expensive relative to the cost of filling it in.  
Also, the timing loop is unrealistic.  We mostly care about small tuples.  


For long term maintenance of the project, I recommend filling the code with 
these unsafe variants which will segfault whenever someone follows the normal 
practice of decreffing when an error is encountered.  This would be yet another 
special case a person would have to learn to do maintenance or code review for 
CPython.

In general, there are a lot of small optimizations to be had if we were to 
forgo principles of loose coupling, defensive programming, and ease of 
maintenance.  Once in a while, we find one that actually is worth it, but 
usually it is a best practice sprinkle these special cases all over the code 
(see MS Code Complete for more discussion on the long term costs of this kind 
of coding).

----------
nosy: +rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36030>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to