Tbh, the vast majority of performance issues don’t come from the language but from the application itself.
While python is clearly slower than rust when it comes to pure native performance when doing exactly the same things exactly the same way and only within the language itself, the same isn’t necessarily true in the bigger picture.
Python uses C modules under the hood. A lot of the functions you call actually utilize C with C performance.
Lower level languages allow the programmer to fail harder. While perfect low-level language code usually runs faster than perfect high-level language, the same cannot be necessarily said for bad or average code. For example, it’s really hard to make an actual memory leak in Python. It’s super easy to do so in languages without built-in memory management. The same applies in many other cases too. Python just gives you a lot of already-done tools that you only have to use, while other languages allow you to build the tools from scratch, which is easy to mess up.
Most performance is lost due to using wrong algorithms or data structures. It’s quite common when optimizing that you e.g. manage to eliminate a nested loop or something like that (e.g. loops hidden inside functions you call), and suddenly you improve performance by a factor of 1000. The same can’t be done by switching languages, where even the most inefficient languages are only maybe 10x slower than the fastest languages.
So independent of the programming language, investing time in optimizing can improve the performance much more than using a faster language, and it’s much easier to make perfectly optimized high-level language code than perfectly optimized low-level language code.
Facts right here. I love Rust and my day job is Python. Neither is too slow for most of my use cases. Though one cool thing about Rust is the super low overhead. So well-written Rust, much like well-written C, is great for low-power devices. Still, the database is going to be memory, IOPS and maybe CPU hungry as it grows. You can optimize data structures, but you still need to read said data.
The user facing side of Piefed is more optimized for speed and low resource use, which fits well with our Solarpunk ethos, and on the backend side I expect it to be easier to maintain and the performance impact should be neglible as most of it is the Postgres database with Lemmy and likely Piefed as well.
And they want to migrate to piefed? Does it have better performance than Lemmy? That would be hilarious if python were faster than rust.
Anti Commercial-AI license
Tbh, the vast majority of performance issues don’t come from the language but from the application itself.
While python is clearly slower than rust when it comes to pure native performance when doing exactly the same things exactly the same way and only within the language itself, the same isn’t necessarily true in the bigger picture.
So independent of the programming language, investing time in optimizing can improve the performance much more than using a faster language, and it’s much easier to make perfectly optimized high-level language code than perfectly optimized low-level language code.
Facts right here. I love Rust and my day job is Python. Neither is too slow for most of my use cases. Though one cool thing about Rust is the super low overhead. So well-written Rust, much like well-written C, is great for low-power devices. Still, the database is going to be memory, IOPS and maybe CPU hungry as it grows. You can optimize data structures, but you still need to read said data.
The main bottleneck is I/O anyway.
It is the medium term plan, yes (if feasible).
The user facing side of Piefed is more optimized for speed and low resource use, which fits well with our Solarpunk ethos, and on the backend side I expect it to be easier to maintain and the performance impact should be neglible as most of it is the Postgres database with Lemmy and likely Piefed as well.