It benchmarks RTT (Round trip time) - sequential and parallel, file upload and JSON parsing time in milliseconds for Python (Flask), Node (Express), Dart (shelf), Dart (conduit) and Dart (dart_frog).
Please open an issue if you find any issues in the benchmarks.
Check README.md for specific backends to see how to run them.
- Run the backend
- Run benchmark
- Note the results
I got the below results by running the benchmark and servers on an AWS t3a.small instance running Ubuntu 22.
The benchmarks are testing backends on 4 bases
- Synchronous request handling
- Asynchronous request handling
- Multi-part requests (File upload)
- JSON parsing
Lesser means better
In this, the client sends a request to the server then waits for the response and then sends another.
The lowest time taken was by Shelf which is still comparable with other frameworks
In this multiple requests are sent to the server and waits for all the responses back from the server.
The fastest one was ExpressJS but again with not a great margin.
Here Flask is the fastest and Dart servers perform a bit slower and conduit is the slowest of all.
The multipart requests are usually made to upload images to a server. In this, I'm sending requests synchronously.
The Dart servers are handling it very slowly. Flask and ExpressJS are killing it.
dart_frog doesn't support it yet, you can track the progress at dart_frog#296.
The Shelf also doesn't provide out-of-the-box support for it but I have used shelf_multipart (a 3rd party package) to handle requests.
In this, I'm stress testing the speed of JSON parsing by frameworks. By sending 1.04MB of JSON data over POST request synchronously.
Again you can see Flask and express are twice as fast as Dart frameworks.
In real world no one will be sending such huge chunks of JSON over the network but these are just for benchmark sake