Message85826
| Author |
rhettinger |
| Recipients |
dschult, loewis, rhettinger |
| Date |
2009年04月09日.21:23:16 |
| SpamBayes Score |
1.1829471e-10 |
| Marked as misclassified |
No |
| Message-id |
<1239312199.25.0.914608525949.issue5730@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Inlining code saves work but breaks the effort to minimize the number of
functions that have direct access to the underlying data structure.
The performance of setdefault() is hard to improve in real apps because
the cost of instantiating the default object is outside of the method.
Also, the method often gets used in a loop where the first call adds an
entry and subsequent calls just do a get; so, any efforts to optimize
the second look-up only help on the first call and are completely wasted
on subsequent calls.
All that being said, there's no reason we can't save the double call to
PyObject_Hash(). See attached patch.
Martin, any thoughts? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年04月09日 21:23:19 | rhettinger | set | recipients:
+ rhettinger, loewis, dschult |
| 2009年04月09日 21:23:19 | rhettinger | set | messageid: <1239312199.25.0.914608525949.issue5730@psf.upfronthosting.co.za> |
| 2009年04月09日 21:23:17 | rhettinger | link | issue5730 messages |
| 2009年04月09日 21:23:17 | rhettinger | create |
|