boostorg / boostorg/beast

Async websocket creates a large binary & object file

Open
#2,013 26 comments 0 reactions 1 assignee Claimed by @madmongo1 View on GitHub
Optimization
Dominant language
C++
Stars
4.8k
Forks
694
Avg merge
12h 48m
Merged PRs (30d)
1

Description

**Version of Boost 1.70 ( 1.73 too )**

Steps necessary to reproduce the problem
--------------

Build sample async ssl websocket example

https://www.boost.org/doc/libs/1_70_0/libs/beast/example/websocket/client/async-ssl/websocket_client_async_ssl.cpp

On Mac OS with clang,
This will produce a **release binary 6.3 MB**. This is not due to OpenSSL. You will see that **object file ( websocket_client_async_ssl.o ) is also 3.8 MB.**

And following statement contributes to shocking **3.1 MB** of it.

// Perform the websocket handshake
ws_.async_handshake(host_, "/",
beast::bind_front_handler(
&session::on_handshake,
shared_from_this()));

while sync version of same ( ws_.handshake ), contributes only 400 KB extra.

File size changes as below.
----------
1. Async ws-handshake - ( obj: 3.8 MB, exe: 6.3 MB )
2. No ws-handshake - ( obj: 0.5 MB, exe: 2.9 MB )
3. Sync ws-handshake - ( obj: 0.9 MB, exe: 3.2 MB )

SSL present in all of above case.

I checked some cases with latest boost version 1.73 also, no noticeable change in reduction. Probably it takes more.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.