New flat_stream example class:

fix #1108

The `flat_stream` is a stream wrapper designed to overcome a
performance limitation of the `boost::asio::ssl::stream`
implementation. Specifically, when writing buffer sequences having
length greater than one, the `ssl::stream` implementation does
not use scatter-gather I/O and instead performs a kernel transition
for every buffer in the sequence.

The wrapper addresses this problem by allocating memory and
presenting the buffer sequence into a single buffer, using
some logic to determine when this allocation is advantageous
versus simply passing the buffers through as-is.

See Also:
https://github.com/boostorg/asio/issues/100
https://stackoverflow.com/questions/50026167/performance-drop-on-port-from-beast-1-0-0-b66-to-boost-1-67-0-beast
This commit is contained in:
Vinnie Falco committed 2018-04-30 19:49:42 -07:00
1 parent dcfd07f6f2
commit c9a445a937
8 files changed
+879 -13

No files matched your search

+10
View File
@@ -216,6 +216,16 @@ listed here along with a description of their use:
in the documentation. It is used by the "flex" servers which
support both plain and SSL sessions on the same port.
]
][
[[source_file example/common/flat_stream.hpp]]
[
This wrapper flattens buffer sequences having length greater than 1
and total size below a predefined amount, using a dynamic memory
allocation. It is primarily designed to overcome a performance
limitation of the current Boost.Asio version of `ssl::stream`, which
does not use OpenSSL's scatter/gather interface for its primitive
read and write operations.
]
][
[[source_file example/common/root_certificates.hpp]]
[