76
you are viewing a single comment's thread
view the rest of the comments
[-] barnaclebutt@lemmy.world 4 points 5 months ago* (last edited 5 months ago)

Or you could use cython, which is much easier to integrate with a python project. It is only marginally slower than Rust but a little less safe. Numpy libraries are usually the fast. Numba is a little clunky, but can also speed up code. There's lots of options to speed up python code.

[-] sugar_in_your_tea@sh.itjust.works 2 points 5 months ago

Yup, Cython rocks.

You can also use numba if you just need to accelerate one part of the app. We did that with a heavy part of the app and our naïve Python (using numpy) was about as fast as our naïve Rust, but only when wr turned on parallel processing in numba (I could've easily beat it with parallel Rust, but that requires extra work and wouldn't fit as nicely into the rest of the app).

this post was submitted on 15 Jun 2024
76 points (91.3% liked)

Python

6394 readers
22 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS