the beast version 72 does not contain beast::to_string, then which api should I use to convert from beast::multi_buffer to std::string
to_string was provided as a way to display the contents of a buffer. For example:
multi_buffer b;
...
std:out << to_string(b.data());
The function sort of didn't belong in Beast because its expensive and there are other ways to accomplish the same result. For example, you can now write this instead:
std::out << buffers(b.data());
Alternatively you can use something other than a multi_buffer, such as a flat_buffer, and construct a string_view from it.
What is your use-case?
Ah, I just found the beast::buffers api right after my post.
One of my use case is performance critical: streaming real-time big data up to 20Mbps from several Websocket servers and then parsing them for analysis. So fast memory operations are preferred
Does your parser require a single contiguous input or can it work with sequence of multiple buffers?
it works with sequence of multiple buffers.
It's a series of json or quasi json data
multi_buffer is good for you then. are there any bottlenecks in Beast? Are you using a profiler?
I'm using Beast in a "multi-threaded, async within each thread" fashion (both http and websocket clients), and so far I haven't noticed any bottleneck, the data streaming seems consistent.
I do have done a http request per second performance comparison with wrk (https://github.com/wg/wrk), using http server crow (https://github.com/ipkn/crow) on a dual Xeon E5 2665 cpu machine, the performance is around half of wrk, roughly 25000 rps.
multiple facts have been taken into accounts: only resolve host once, only reconnect on EOF or disconnection, minimum memory allocation during requests, etc.
Please let me know what I can do to help to make sure Beast does what you need!
25K rps is no joke, I'm getting around 5K and I have a pretty powerful gaming rig although we're probably comparing apples to kiwis at this point.
Sure, and glad to to see beast is evolving actively.
Just wondering, have you starred the repo?
I follow you instead.. ;)
vinnie, focus on your boost incubator, once admitted, it could bring you 10x stars!
LMAO
Most helpful comment
I follow you instead.. ;)
vinnie, focus on your boost incubator, once admitted, it could bring you 10x stars!