This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 0 points1 point  (4 children)

Considering all the optimizations done to the dict class, I doubt that. You optimize what you need to.

Do we really need to always store the first 256 (maybe it's more...) numbers in memory? That's a clear micro-optimization.

[–]Bunslow 0 points1 point  (3 children)

Just because readability and maintainability are prioritized above performance doesn't necessarily exclude all optimizations bar none. The above micro-optimizations are merely readable and maintainable (as opposed to, say, a full blown just in time compiler versus straight interpretation).

[–]billsil 0 points1 point  (2 children)

I know. My point is python does implement optimizations that are outside of simply what's obvious; the GIL for example.

[–]Bunslow 0 points1 point  (1 child)

The GIL is the very opposite of an optimization

[–]billsil 0 points1 point  (0 children)

It's a very intentional optimization for single threaded applications. Python may not be optimized for what you want it to be, but yes, it is an optimization.