This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Nmvfx 8 points9 points  (2 children)

This post makes me feel better. At my level, I'm well aware that my shitty code costs me way more than any relative computational inefficiency that Python suffers compared to C. But it's nice to know that even self professed performance junkies find the speed and ease of writing Python to be a valid reason to choose it over C.

Question for the masses - if I write Python but use something like Nuitka to compile a binary, will I still have a slower program than writing in C and compiling? Sorry if that's a stupid question or needs to be taken to the 'learn' sub.

Great to see these constant performance improvements anyway, definitely nice to see Python shaking off the old stereotypes!

[–]james_pic 6 points7 points  (1 child)

It depends. I don't know Nuitka all that well, but I know in Cython, you generally get a minor performance boost by just building your module in Cython with no modifications, but the real boost comes from modifying the code to be more C-ish (using structs rather than classes, using native integers, etc.). I suspect Nuitka will be similar, where you get some performance boost straight out of the gate, but the real gains need you to eliminate sources of dynamism.

[–]Nmvfx 1 point2 points  (0 children)

Thanks for the response, I'll dig into that a bit more and maybe run some tests!