How many request per seconds can handle Adonis.js?
0. Sorry to piss of you, but this is the most stupid question, I would want to answer and want the AdonisJs community to think off.
X responds in
10ms and framework
Y responds in
12ms, does it make any difference? The apps should have a benchmark and anything below that benchmark is good.
Build a decent size app (with database) in Fastify and AdonisJs both and then tell me which one is fast.
Finally, there are no performance bottle necks in AdonisJs and we are not obsessed with micro performance either. Please read this article too https://hueniverse.com/when-500-faster-is-garbage-553121a088c3
In a fast world we can talk about speed. Adonis.js has the most beautifull code structure from all of the frameworks out there, but it is too slow to build an ecommerce with many users for example, which a framework like amber or django can handle very easy a situation like that.Express.js with orm is also slow.So, let’s try to figure out a way to have also the speed included.
Cheers and have a great day!
Python is slower than NodeJS
Go is even faster than NodeJS
Actix (written in Rust) is even faster than Go
Web server over 2x faster than Nginx, about 15% faster than Actix and takes only 83 bytes of memory!
According to hackernews it is fastest web server (reference link 404s ) . Good luck developing something on Assembly tho =)
Quite some time ago I developed WordPress 2.0 on Adonis (this project died, since Hugo is good enough for me and I made it just to learn Adonis)
But here is fetching posts performance
If I remember correctly it was 500 clients and 200k requests
Time taken for tests: 3.211 seconds Failed requests: 0 Requests per second: 62282.69 [#/sec] (mean) Time per request: 8.028 [ms] (mean) Time taken for tests: 429.340 seconds Failed requests: 224 Requests per second: 465.83 [#/sec] (mean) Time per request: 1073.350 [ms] (mean)
Since I did it almost a year ago I can’t really what I used for testing. I think Apache AB or something. Test env was Ryzen 7 2700x and 64GB of RAM (might remember it wrong tho)
But even looking at that and comparing Adonis with Actix (over 20x faster) Adonis is super slow…
I think if you really need speed you should be looking at Rust.
And from the other side. How much time it will take to learn Rust?
If you finally master Rust and Actix to make anything decent in it, how much faster / slower will developing new features will be compared to Adonis?
I’m quite sure Adonis will never beat speed of Actix. But really… Servers are so cheap nowadays… It is A LOT cheaper to order better server than learn new tech stack just to get that extra speed…
Why Walmart moved to NodeJS when they could’ve moved to Rust to get even more performance? If NodeJS is fast enough for Walmart, I think it is fast enough for all pages / API’s I have been developing so far.
In the end I think you should think about does that ~10% performance increase is worth 2x longer developing time, when comparing different NodeJS frameworks (not true numbers, made them up. But that’s how they differ mostly)
Different frameworks solve different problems You should choose framework based on your / team skills, problem you are trying to solve and time you have for it.
Or maybe get working product out that starts to get you money as soon as possible and when you have performance issues start to optimize? Saying
"Premature optimization is the root of all evil" exists for a reason
Quite many years ago asked CTO of one bank:
"Why you develop on Java, when you could save server when you write everything in C or C++?
Response: Servers are cheaper than time and developers
We use Adonis along with ExpressJs and GoLang (GoKit) in a microservice architecture and various AdonisJS repositories are handling 1,000,000+ orders per day.
It’s a fair question but grossly over simplified. AdonisJs/NodeJs is fast enough for your needs. The implementation/infrastructure is down to yourself.
Try to compare apples with apples.Django with py 3 it is slower than Express. js, BUT it is faster than Express. js with an ORM, look at Sails.js.
Search on techempower at json serialization to see the difference.
Speed of code execusion is the last thing you should worry about when choosing a tool for you work, your own productivity is important.
If that’s the case, there would not exist so many programming languages.
Let’s take a concrete example: if you have a project related to image processing, your first question will not even be the algorithm(s) to use but the tools to use because you will need to loop over millions of pixels per image, for each pixel you will have to study its 8 neighboring pixels given different criteria;
so for this situation you would choose a programming language over an other, for example a programming language which allows you to loop faster must be your priority (
for loops in Python are slow compared to C, for instance)
Laravel it is a great framework, the same as Adonis.js. My point of view is that in pwa/iot/mobile apps era the speed is very important.The only framework that runs 129000 json request per seconds is Django with py 3.Express.js is very slow with mysql and an orm, look at Sails.js, that it can handle only 4000 request per seconds.
Well, then go with Django and you’ll be happy.
Can you show where you got those numbers for Django?
Shows Django as one of the slowest ways to go. Or are you comparing Express fetching data from database and Django responding with static JSON?
If I compare ‘SELECT * FROM users’, serialize to JSON and send response back to client I get more req/sec thoughtput on Express than Django…
And I still don’t get it why you choose Django when you need speed… Actix can run over 7 million requests per sec according to some benchmarks…
According to this Django with Python 3 is about 2x slower than Laravel and about 4x slower than Express…
look at json serialization
Most likely JSON Serialziation benchmark will not give you anything useful. It is relevant only when you respond with
If you’d like to get any kind of relevant information you should look at
Multiple queries and
Data updates, maybe
Single query too, based on your application.
Also take a look at round 18, since it is more up to date.
You can take a look at benchmarks source code to see, if is relevant at all for your application. For my most applications those benchmarks in there are totally irrelevant (but you still get something out of there). Since real life applications and synthetic benchmarks differ quite a lot.
A spa/pwa/mobile app rely on json, so it is relevant enough to see in what time an user get a response, that give your app speed.
Your Logic makes me laugh, sorry…
you have a great logic that nobody see it…don’t keep it just for yourself
@razvacos I believe it will help see the larger picture. Other replies here allude to that point - will not elaborate more.
If you believe JSON serialization is super important **and ** it is super relevant to your project, then go ahead and use the framework and be done with it. But do remember to test in your own environment, with your data and application logic. And, include ease of development into the consideration.
I have projects that use base-Adonis with real-time and batch logic, and application layer that pans mobile app and browsers supporting multiple form-factors. The server side of things necessitates different layers to be leveraged - right from database through application/business logic on Adonis including validations, role-based access, and multiple types of queries (e.g. single/multiple, different / crazy relationships).
I find Adonis better than the other frameworks that I tried out -
- ‘better’ referring to the real-world performance (which was more than acceptable)
- … and what was probably more important for a small dev team - new features and changes were easy to develop and maintain
I do respect what you are trying to put out there, but arguments based on theoritical numbers without drilling down to specifics of a problem may not be the best approach.