Hacker News new | ask | show | jobs
by imoldfella 4143 days ago
Did you consider libuv? If so why asio over libuv. I've never taken time to benchmark them, but I have built web servers on both. Libuv has broader api support like cross platform file aio. Asio has more convenient c++ bindings, but there are some third party bindings that I haven't tried.
3 comments

Async filesystem I/O isn't a priority for modern webapps / HTTP API endpoints that primarily just slam a database.

That said, I somewhat agree wrt ASIO. I've not quite been able to get ASIO to put out the reqs/sec, and the API is iffy in some areas, even when using C++14. Imho it's tolerable with the coroutine integration, but then debugging becomes a nightmare (forget exceptions because basically every socket operation can and will throw if the client does anything iffy)

I also think that with async/await probably coming with the next c++ standard, we will be able to write much simpler async code in plain C++, without Asio.
libuv could be one of the futur backends yes. But with microhttpd silicon is able to handle more req/s that most other web frameworks. I am more focused on stabilizing the code base, documentation, and adding support for other databases.