Message298491
Sorry, I don't have much data at this point, but it's not the first time that I noticed that namedtuple is super slow. We have much more efficient code like structseq in C. Why not reusing it at least in our stdlib modules?
About the _source attribute, honestly, I'm not aware of anyone using it. I don't think that the fact that a *private* attribute is document should prevent it to make Python faster.
I already noticed the _source attribute when I studied the Python memory usage. See my old isuse #19640: "Drop _source attribute of namedtuple (waste memory)", I later changed the title to "Dynamically generate the _source attribute of namedtuple to save memory)".
About "Python startup time doesn't matter", this is just plain wrong. Multiple core developers spent a lot of time on optimizing exactly that. Tell me if you really need a long rationale to work on that.
While I'm not sure about Naoki's exact optimization, I agree about the issue title: "Optimize namedtuple creation", and I like the idea of keeping the issue open to find a solution. |
|
Date |
User |
Action |
Args |
2017-07-17 12:33:51 | vstinner | set | recipients:
+ vstinner, rhettinger, ncoghlan, pitrou, eric.smith, methane, serhiy.storchaka, xiang.zhang, JelleZijlstra |
2017-07-17 12:33:51 | vstinner | set | messageid: <1500294831.25.0.819011806412.issue28638@psf.upfronthosting.co.za> |
2017-07-17 12:33:51 | vstinner | link | issue28638 messages |
2017-07-17 12:33:51 | vstinner | create | |
|