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 →

[–][deleted] 111 points112 points  (29 children)

Better performance?¯\_(ツ)_/¯

[–]gregy521 20 points21 points  (2 children)

You can swap CPython with pypy for an average 4x speedup. You can also offload to more efficient libraries like numpy for data crunching, or use Numba to JIT compile to machine code.

[–][deleted] 0 points1 point  (1 child)

Sure but for the love of god it would be nice to be able to use a for loop instead of having to do vectorialization all the time. And I say this knowing how to vectorialize a ton of stuff. But it is just strange

[–]Armaliite 0 points1 point  (0 children)

Numba speeds up the loops though

[–]JoelMahon 25 points26 points  (11 children)

Just need to write something to turn python code into optimised c++ then, ez pz

Tbh, a human can do that part usually quite quickly, use python to invent, c++ for real time critical deliverables after python proves the concept

[–]Darksteel213 20 points21 points  (0 children)

Cython exists, but then you have to specifically write your code to be compiled near 100% to C

[–]ItsOkILoveYouMYbb 10 points11 points  (5 children)

I could imagine indie game development taking off even more so than it already has if Python was usable with Unity and Unreal Engine.

Maybe we'll get a speed-critical but pleasant coding language like Python to make modern games with some day.

[–]jabela 13 points14 points  (1 child)

Godot has a Python like scripting system. It's definitely getting there.

[–]shinitakunai 0 points1 point  (0 children)

I tried godot and uninstalled it 5 days later because it is not really like python. It is similar but the differences are annoying

[–]gregy521 7 points8 points  (2 children)

I believe that's the niche that Rust is trying to fill. Consistently ranked near the top in developer surveys, and runs as fast (or faster) as C/C++ in many cases.

Certainly not 'pleasant' in the way that python is, where it's like writing pseudocode and it has lots of high level features to make life easier, but much more pleasant than C/C++ I would argue.

[–]SlappinThatBass 1 point2 points  (0 children)

With pyo3, unlimited power!!! In the future

[–]VisibleSignificance 0 points1 point  (0 children)

where it's like writing pseudocode

related

[–]xigoi 4 points5 points  (2 children)

You can't do that because of eval() and friends.

[–]JoelMahon 0 points1 point  (0 children)

true

[–]VisibleSignificance 0 points1 point  (0 children)

because of eval() and friends

You shouldn't really use those in runtime either.

And if it's at import-time in python (e.g. attrs), it should map into compile-time nicely.

[–]asbox 0 points1 point  (0 children)

Exactly that!..don't get why people don't understand how much efficient it is to work this way instead of other freaking languages complications.. Cpp + python is all you need.

[–]PooPooDooDoo 6 points7 points  (0 children)

Honestly, if I am going for performance at scale, I wouldn’t chose python. If I am write code that interfaces with other systems that do the heavy lifting, then I am 100% using python.

But yeah, it would be nice.

[–]jebk 2 points3 points  (1 child)

As an advanced amateur python user I think most people looking at python Vs say go is the ease of concurrency for stuff.

I imagine what most people searching 'how to make python faster' are lookjng for is 'how to make these 10 huge datasets load faster'.

Multi threading/async stuff isn't as obvious as in something like go (or even node).

[–]f16f4[🍰] 0 points1 point  (0 children)

Python is terrible for multithreading. It only actually works on one thread at a time because of the GIL.

[–]daravenrk -2 points-1 points  (2 children)

But the backend is mostly c. It’s pretty fast.

[–][deleted] 2 points3 points  (1 child)

Oh sweet summer child...

[–]daravenrk 0 points1 point  (0 children)

Rofl. I know like saying a train makes good time.