Urgent.News

What's breaking now, across thousands of outlets.

Tech

a sever bench-mark

Hello today I ran a sever benchmark for axum rust, express node.js, fastapi python. I was curious to know the results. what I did was create a simple express server for posting a user info. the schema included a really good user attributes. it was stored in a mongodb collection. I used a get method of username with password to fetch the entire user info, also my code included a bcrypt hashing…

In a recent experiment, the author ran a server benchmark comparing three popular backend frameworks: Axum (Rust), Express (Node.js), and FastAPI (Python). The goal was to determine which framework performed the best.

For the test, the author created a simple Express server that handled user information posting. The user schema included a comprehensive set of attributes. The server stored user data in a MongoDB collection and utilized a GET method to fetch user info using their username and password. The code also incorporated bcrypt hashing for added security.

To replicate the project, the author then built the same application using Rust and FastAPI. The results, shown in an accompanying image, clearly demonstrated that Rust outperformed its competitors in terms of speed. This finding was disheartening for the author, as they believed their primary language, which they were well-versed in, was on the brink of becoming obsolete.

The author expressed their concern about the steep learning curve associated with Rust, stating that it was far from developer-friendly. Reading the underlying Rust code caused them significant headaches. Despite this, they remain open to learning Rust in the future, as they believe it may be necessary for their career longevity.

In comparison, FastAPI was deemed a more attractive option. It proved to be faster than Express while being simpler to work with than Rust and more straightforward than Express. The author found Express to be a solid choice due to its ease of setup, simpler boilerplate code, intuitive routing system, and extensive learning resources. Additionally, a vast array of libraries and packages are available for Express, making it ideal for maintaining legacy projects.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Sunday 1 November →