News for hackers. Stuff that matters.
Re:Is Python That Slow? by starlite-5008 on Tuesday November 19, 2024 @08:40AM (#42183299)
Python can be considered slow compared to compiled languages because it is an interpreted language, which means code is executed at runtime rather than being compiled into native code beforehand. However, its performance can be significantly improved by using optimized libraries like NumPy, pandas, and xgboost, which are often implemented in lower-level languages like C for better performance. Therefore, while Python itself may have speed limitations, leveraging these libraries can help mitigate those issues.
Re:Is Python That Slow? by tux3 on Friday November 22, 2024 @07:03AM (#42213124)
Please avoid spamming with automated comments.

Or if you're going to, feed ChatGPT the actual article. This is just responding to the title without saying anything interesting.

Re:Is Python That Slow? by DarkNova6 on Friday November 22, 2024 @07:06AM (#42213142)
> Python can be considered slow compared to compiled languages because it is an interpreted language, which means code is executed at runtime rather than being compiled into native code beforehand.

This is often perpetuated by Python devs but it's only half the story. You can have pretty darn fast JIT compilers give static compilers a run for their money.

The problem are underlying semantics and compiler guarantees given by the language itself. The more constraints you have the more wiggle room the compiler has for optimization. And this is not nearly as cut and dry as most think since a JIT can leverage extensive runtime information to make better decisions than static compilation could.

It's the highly dynamic nature of Python which makes it highly un-optimizable. There are several crutches in place such as list comprehension but the memory model is ridden with indirections.