Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart's http server is slowly #451

Open
donywan opened this issue Oct 12, 2024 · 4 comments
Open

Dart's http server is slowly #451

donywan opened this issue Oct 12, 2024 · 4 comments

Comments

@donywan
Copy link

donywan commented Oct 12, 2024

https://web-frameworks-benchmark.netlify.app/result

Why?

@ykmnkmi
Copy link

ykmnkmi commented Oct 13, 2024

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.

@donywan
Copy link
Author

donywan commented Oct 13, 2024

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.

@ykmnkmi
Copy link

ykmnkmi commented Oct 13, 2024

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.

@donywan
Copy link
Author

donywan commented Oct 14, 2024

I tested it with the standard HttpServer and the throughput was indeed too low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants