this post was submitted on 15 Jun 2023
164 points (99.4% liked)
Programming
17486 readers
107 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Rust is not to blame, but that code that has been written in Rust might be to blame.
The algorithms used have more effect than the language used, and Rust might make using certain algorithms more painful and thus steer programmers towards less efficient algorithms. Using
clone
is often an example of this, it's a little easier and gets around some borrow checker difficulties. (This is true in general, but I don't know if this is what has happened with Lemmy.)Look at salvo [diesel] coming it at #200+ on this benchmark1, lots of programming languages have at least one framework that is faster on the microbenchmark. This isn't especially meaningful, but it does show that, let's say, a feature rich framework in Rust might end up being slower than a Python framework that's laser focused on the specific use case.
There’s a catch here, something I read someone mention on Hacker News and I agree. Python is easy when you don’t care about performance; the moment you need to worry about it, all the easiness gets thrown away.
Everything is easy when you don't care about performance.
Have you ever used py-spy? It's an excellent profiler for Python code (written in Rust 😉). It can attach to a running process and tell you what line is taking the most time. Seems pretty easy to me. (Which is not to say Python can achieve optimal C speed.)
I don't think there's such an easy profiling tool for C or Rust? But I'd be happy to be proven wrong here.