Open donywan opened 3 days ago
In JS, the base part of the HTTP server is implemented in native code, it's just Zig, Rust, C++ with JS bindings. In Dart case, it's all written in Dart and native socket bindings. Dart is reading all the bytes, parsing them, and putting them into the streams.
Is there any possibility of improvement?In this way, dart can also be used as a backend.
In JS, the base part of the HTTP server is implemented in native code, it's just Zig, Rust, C++ with JS bindings. In Dart case, it's all written in Dart and native socket bindings. Dart is reading all the bytes, parsing them, and putting them into the streams.
Dart is used as a backend. A 2ms vs 5ms diff is not that much. If you want to improve the standard HttpServer
, take a look at http_io to experiment.
I tested it with the standard HttpServer
and the throughput was indeed too low.
https://web-frameworks-benchmark.netlify.app/result
Why?