20
submitted 4 months ago* (last edited 4 months ago) by Asudox@lemmy.world to c/programming@programming.dev

So I want to make a new project. It will have a website and an algorithm which will handle the requests. The thing is, web development in Rust feels harder than say in Go or Python. So I thought maybe I could somehow make bindings in Rust for Go since the faster the algorithm is, the better. However, that seems to complicate stuff as well. So do you think I should just rewrite the current algorithm in Go? Is it fast enough for it to not be a noticeable difference?

Edit: Thanks for the suggestions and advice! I decided to go with Rust for the website with Axum and the algorithm as well.

you are viewing a single comment's thread
view the rest of the comments
[-] bizdelnick@lemmy.ml 41 points 4 months ago

Premature optimization is the root of all evil. Implement algorithm the easiest way possible, profile your application, determine if this implementation a bottleneck or no. If yes, try other implementations, benchmark them and find the fastest one. Note that optimized go code can be faster than non-optimal code in rust, C, assembly or any other language.

[-] thtroyer@programming.dev 3 points 4 months ago

Absolutely.

I've seen so many projects hindered by bad decisions around performance. Big things like shoehorning yourself into an architecture, language, or particular tool, but even small things like assuming the naive approach is unacceptably slow. If you never actually measure anything though, your assumptions are just assumptions.

this post was submitted on 26 Feb 2024
20 points (77.8% liked)

Programming

16210 readers
613 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