Message218582
| Author |
vstinner |
| Recipients |
lebedov, rhettinger, vstinner |
| Date |
2014年05月14日.22:18:49 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1400105930.13.0.182632478399.issue21507@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
frozenset constructor has different implementations depending on the input type: set (or frozenset), dict or iterator. The constructor preallocates the frozenset for set and dict, but not for generic iterator and so the set may have a suboptimal size.
Attached patch set_length_hint.patch optimizes also the 3rd case using operator.length_hint (PyObject_LengthHint in C).
Since it is an optimization, I prefer to only apply it to Python 3.5 to limit the risk of regression. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年05月14日 22:18:50 | vstinner | set | recipients:
+ vstinner, rhettinger, lebedov |
| 2014年05月14日 22:18:50 | vstinner | set | messageid: <1400105930.13.0.182632478399.issue21507@psf.upfronthosting.co.za> |
| 2014年05月14日 22:18:50 | vstinner | link | issue21507 messages |
| 2014年05月14日 22:18:49 | vstinner | create |
|