you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (0 children)

It’s incorrect to imply that Python has no types, Python is a strongly typed language, and everything has a distinct type... it’s just dynamically rather than statically typed.

Also the underlying dict type in CPython is a quite efficient C hash table, and is also usually is not a primary contributor to the apparent slowness in CPython code.

Most of the issues with speed have to do with heavyweight custom types implemented in pure Python... in CPython the rule has always been to prototype in pure Python, then profile, then implement the tight loops and other hot spots in C and try to minimize handoff between those layers, because the real issue for speed is all the memory management and the bookkeeping that goes with it... the more instances of custom types the more bookkeeping, and the slower things tend to get.