tomaka / rouille

Web framework in Rust
Apache License 2.0
1.12k stars 106 forks source link

[WIP] Use mio instead of tiny-http #144

Open tomaka opened 7 years ago

tomaka commented 7 years ago

cc #27

cardoe commented 6 years ago

What's the status on this work? It could be good to combine this with #154 as a new major version (realistically for a major version bump I'd drop rustc-serialize entirely).

tomaka commented 6 years ago

The code here is working, but it's not tested. I was more or less hoping that Rust would support generators soon-ish (not async, just coroutines for parsing), but it looks like we're still far away from them.

mentalbrew commented 6 years ago

What would the process be to get this PR and the Serde PR implemented? These two PRs would be a great boost for the project though I'm sure other concerns come in to play here.

cardoe commented 6 years ago

Well the Serde update is ready for review. It has obvious backwards compat issues so there is a question there.

tomaka commented 6 years ago

So the problem with this PR right now is that it breaks websockets. Websockets is a bit tricky because it's touching the topic of asynchronous I/O in Rust.

Other than that, I think there are some minor problems such as HTTP error codes not being returned in some situations (eg. request line too long), and performances could be improved.

jaemk commented 6 years ago

The performance gains from this PR are really impressive! Running the hello-world example goes from 19k req/s to 83k req/s (with wrk -t4 -c100 -d10s)

I did notice two issues though:

tomaka commented 6 years ago

Thanks for the investigation! That's unfortunate.