Python Love Haunts Back

Apr 16, 2025 6:52 AM

typeof

Views

1531

Likes

46

Dislikes

4

programmer_jokes

funny

lol

humor

memes

Now do Rust!

3 months ago | Likes 4 Dislikes 0

With today's CPUs the increase in performance is usually imperceptible unless you're running an algorithm in exponential time. Never pre-optimize. Developer time is almost always a more precious resource.

3 months ago | Likes 1 Dislikes 0

Give Go a go

3 months ago | Likes 2 Dislikes 0

It is usually the other way around.
An amazing programmer can write in 100 lines what an beginner programmer needs 1000 lines for. And it is more proficient, less resource intensive, and faster.

3 months ago | Likes 6 Dislikes 3

Not always the case, generally more expierenced programmers will use more shorthands in the code, its faster to write but does not impact performance as the compiler will compile it the same as writing it full-out. And (atleast used to be for me) its harder to read shorthand code when trying to learn.

3 months ago | Likes 4 Dislikes 0

The post is comparing C++ to Python so basically speed and power vs ease of implementation

3 months ago | Likes 2 Dislikes 0

Also, the python modules pulled in are probably being counted as one per import. Many modules are also written in c++.

3 months ago | Likes 2 Dislikes 0

My lesson was trying to write a sorting algorithm. I went bubble because it seemed the simplest. Imagine my shock when I looked up a bubble function and it was just two lines...

3 months ago | Likes 2 Dislikes 0

I transpile my completed python code using Nuitka, and that generally offers a 2x to 4x performance increase on my projects... However, on compute-heavy tasks, I've observed up to a _10x_ increase in performance. So there's that.

3 months ago | Likes 9 Dislikes 0

I understood some of those words v

3 months ago | Likes 1 Dislikes 0

Is Cython still a thing? Been a while since I've had performance considerations in Python.

3 months ago | Likes 2 Dislikes 0

I think it is. Cython is a superset of Python that allows static type declarations and direct integration with C/C++. I settled/prefer Nuitka because it's a source-to-source compiler that basically translates Python code into C++ and then generates standalone executables. I can distribute my shit wholesale without having to do any extra mumbo jumbo. Plus, Nuitka Optimizes the ENTIRE program flow (function inlining, dead code elimination), which can outperform Cython in certain scenarios.

3 months ago | Likes 2 Dislikes 0