3 ms·
namedtuple's startup performance is terrible, because formatting a string class definition and passing it to exec is slow. The controversy (https://lwn.net/Arti
by ameliaquining 9y ago
namedtuple's startup performance is terrible, because formatting a string class definition and passing it to exec is slow. The controversy (https://lwn.net/Articles/730915/ https://lwn.net/Articles/730915/) was about whether startup performance is worth optimizing (the decision was yes and namedtuple is apparently going to be rewritten in C). Instances of namedtuple are plenty fast.
- gshulegaard 9y agoStartup performance is understandably terrible, the bit of clever metaprogramming I reference above is the reason. I am talking about member access as far as performance goes. The references I link I think go into better detail than I can.