4 ms·
Indeed, and that's why I love it. When I need extra performance, which is very rarely, I don't mind spending extra effort outsourcing it to a binary module. Mor
by ihaveajob 4y ago
Indeed, and that's why I love it. When I need extra performance, which is very rarely, I don't mind spending extra effort outsourcing it to a binary module. More often, the problem is an inefficient algorithm or data arrangement.
I took a graduate level data structures class and the professor used Python among other things "because it's about 80 times slower than C, so you have to think hard about your algorithms". At scale, that matters.
- thesuperbigfrog 4y agoGlobal Interpreter Lock (GIL) is also an issue affecting Python execution speed: https://en.wikipedia.org/wiki/Global_interpreter_lock https://en.wikipedia.org/wiki/Global_interpreter_lock
- dralley 4y agoNot really, no. It prevents you from taking advantage of multiple cores. Doesn't really impact straight-line execution speed. A data structures course is primarily not going to be concerned with multithreading.
- thesuperbigfrog 4y ago>> It prevents you from taking advantage of multiple cores. Doesn't really impact straight-line execution speed. Most computers running Python today will have multiple cores. If your program can only use a fraction of its available computing power, it affects the program's execution speed. Python is too widely used in compute-intensive applications (e.g. machine learning) for GIL-related issues to be ignored in the long term. Ideally, Python should have automatic load scaling and thread-safe data structures in the standard library to take advantage of all available CPU cores. Java has had concurrent data structures in its standard library for years and is adding support for "easy" multi-threaded execution with Project Loom. Python needs to add its own Pythonic versions of thread-safe data structures and compute load scaling to take advantage of the multi-core CPUs that it runs on. >> A data structures course is primarily not going to be concerned with multithreading. A graduate-level data structures course might include concurrent and parallel data structures.