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.
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.
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.
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...
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.
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.
amp99
Now do Rust!
majortool
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.
GoodGuyGonzo
Give Go a go
SirHonytawk
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.
Filolial
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.
TheBigHank
The post is comparing C++ to Python so basically speed and power vs ease of implementation
PinkEater
Also, the python modules pulled in are probably being counted as one per import. Many modules are also written in c++.
BuiltonSin
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...
NChomsky
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.
WarWizardPhoenix
I understood some of those words
v
NoCapForRealForReal
Is Cython still a thing? Been a while since I've had performance considerations in Python.
NChomsky
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.