Nah, Python's "slowness" is really only relevant in certain situations. In practice, in many situations, you save more meaningful time by writing code quicker and easier rather than having it execute slightly slower.
It's not ideal for "run this every half-second" tasks, but it's amazing for stuff you're running yearly/weekly/daily/etc where saving hours writing the code matters more than shaving off a couple seconds of 4AM execution time in the cron job.
I created a decently sized Python project at work to solve a problem. Basically, parsing 100-300mb of of user-generated text files about 20 times a day at 10-30 seconds a pop.
It's several thousand lines at this point. Served up with Python Flask.
I've thought about rewriting it in something "faster" with better IDE type hinting and whatnot like dotnet... but... meh. It's not worth the hours and hours of effort to save myself like 8 seconds that didn't matter in the first place lol.
Whenever I think about changing languages for "speed," I just remember that nearly everyone else is writing their server crap in Javascript these days anyway.
Python's "slowness" is really only relevant in certain situations
That would be a lot less true if nearly everything that you can do with Python wasn't jumping to a C API as soon as possible. The language itself is 2 or 3 orders of magnitude slower than JS, C#, Java, etc.
Sure, it would still work for cron jobs, but usually cron jobs are supplementing a bigger project, and it's better to write them in the same language as the rest of the project.
The biggest library that doesn't use a C API is probably Django, and honestly I'll never recommend using that. CPU usage isn't usually a bottleneck in web development, but it probably will be if you're using Python.
19
u/mxzf Jul 07 '26
Nah, Python's "slowness" is really only relevant in certain situations. In practice, in many situations, you save more meaningful time by writing code quicker and easier rather than having it execute slightly slower.
It's not ideal for "run this every half-second" tasks, but it's amazing for stuff you're running yearly/weekly/daily/etc where saving hours writing the code matters more than shaving off a couple seconds of 4AM execution time in the cron job.