-
[async_mqtt](https://github.com/redboltz/async_mqtt)
-
[async-mqtt5](https://github.com/mireo/async-mqtt5)
-
[mqtt_cpp](https://github.com/redboltz/mqtt_cpp)
Underlying protocol support
functionality\library | async_mqtt | async-mqtt5 | mqtt_cpp |
---|---|---|---|
TCP support |
x |
x |
x |
TLS support |
x |
x |
x |
Websocket support |
x |
x |
x |
Websocket on TLS support |
x |
x |
x |
Asio style support
functionality\library | async_mqtt | async-mqtt5 | mqtt_cpp |
---|---|---|---|
Completion Token support |
x |
x |
- |
[Default Completion Token](https://www.boost.org/doc/html/boost_asio/overview/composition/token_adapters.html) support |
x |
x |
- |
Operation cancel support |
x |
x |
- |
[Associated Characteristics](https://www.boost.org/doc/html/boost_asio/overview/model/associators.html) support |
x |
x |
- |
MQTT protocol support
functionality\library | async_mqtt | async-mqtt5 | mqtt_cpp |
---|---|---|---|
Protocol Version 5.0 support |
x |
x |
x |
Protocol Version 3.1.1 support |
x |
- |
x |
AUTH packet custom authentication support |
x |
x |
- |
Clean Start support |
x |
- |
x |
Keep Alive support |
x |
x |
x |
Receive Maximum property flow control support |
x |
- |
x |
Maximum Packet Size property limitation support |
x |
partial |
x |
Topic Alias property support |
x |
x |
x |
Topic Alias auto extract |
x |
- |
x |
Topic Alias auto assign |
x |
- |
x |
Topic Alias resend regulate packet |
x |
- |
x |
Misc
functionality\library | async_mqtt | async-mqtt5 | note |
---|---|---|---|
High level easy to use APIs support |
x |
x |
|
Low level detailed operation APIs support |
x |
- |
|
MQTT Client APIs support |
x |
x |
|
MQTT Server(broker) APIs support |
x |
- |
Send CONNACK, SUBACK, etc |
Auto adjust protocol behavior support |
x |
- |
Receive Mamixum, Topic Alias, etc |
Separate Compilation support |
x |
- |
Once built the library, then next time faster complation |
Auto reconnect support |
- |
x |
See Resend message |
Multiple broker connect support |
- |
x |
|
logging |
x |
- |
define ASYNC_MQTT_USE_LOG to enable logging |
Offline publish support |
x |
- |
Out of MQTT spec |
Footprint size optimize (-Os) |
4,660kb |
4,324kb |
|
Compilation Time no optimize |
28.9s |
17.6s |
15.6s (async_mqtt separate-compilation-mode application part) |
Compilation Time size optimize (-Os) |
32.9s |
19.9s |
16.8s (async_mqtt separate-compilation-mode application part) |
Detail information of Compilation Time and Footprint size
-
Repository for measuring:
-
Commit hash:
-
Operating system
-
Linux 6.8.7-arch1-2 #1 SMP PREEMPT_DYNAMIC Fri, 19 Apr 2024 09:51:31 +0000 x86_64 GNU/Linux
-
-
CPU
-
Intel® Core™ i7-6700 CPU @ 3.40GHz, 8 cores
-
-
RAM
-
64GB
-
git clone https://github.com/redboltz/footprint_m5.git
cd footprint_m5
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS="-std=c++20" ..
Compilation time (no optimization)
async-mqtt5 (header-only)
time make check_async-mqtt5
[ 50%] Building CXX object CMakeFiles/check_async-mqtt5.dir/src/check_async-mqtt5.cpp.o
[100%] Linking CXX executable check_async-mqtt5
[100%] Built target check_async-mqtt5
make check_async-mqtt5 16.81s user 0.74s system 99% cpu 17.598 total
async_mqtt (header-only)
time make check_async_mqtt
[ 50%] Building CXX object CMakeFiles/check_async_mqtt.dir/src/check_async_mqtt.cpp.o
[100%] Linking CXX executable check_async_mqtt
[100%] Built target check_async_mqtt
make check_async_mqtt 27.70s user 1.08s system 99% cpu 28.867 total
async_mqtt (separate-compilation-mode) library part
Separate compilation library part (only once build required).
time make async_mqtt
[ 50%] Building CXX object CMakeFiles/async_mqtt.dir/src/async_mqtt.cpp.o
[100%] Linking CXX static library libasync_mqtt.a
[100%] Built target async_mqtt
make async_mqtt 50.56s user 2.33s system 98% cpu 53.452 total
async_mqtt (separate-compilation-mode) user code part
time make check_async_mqtt_separate
[ 50%] Built target async_mqtt
[ 75%] Building CXX object CMakeFiles/check_async_mqtt_separate.dir/src/check_async_mqtt_separate.cpp.o
[100%] Linking CXX executable check_async_mqtt_separate
[100%] Built target check_async_mqtt_separate
make check_async_mqtt_separate 15.59s user 0.98s system 99% cpu 16.633 total
Compilation time (size optimization (-Os))
async-mqtt5 (header-only)
time make check_async-mqtt5
[ 50%] Building CXX object CMakeFiles/check_async-mqtt5.dir/src/check_async-mqtt5.cpp.o
[100%] Linking CXX executable check_async-mqtt5
[100%] Built target check_async-mqtt5
make check_async-mqtt5 19.45s user 0.40s system 99% cpu 19.898 total
async_mqtt (header-only)
time make check_async_mqtt
[ 50%] Building CXX object CMakeFiles/check_async_mqtt.dir/src/check_async_mqtt.cpp.o
[100%] Linking CXX executable check_async_mqtt
[100%] Built target check_async_mqtt
make check_async_mqtt 32.38s user 0.47s system 99% cpu 32.939 total
async_mqtt (separate-compilation-mode) library part
Separate compilation library part (only once build required).
time make async_mqtt
[ 50%] Building CXX object CMakeFiles/async_mqtt.dir/src/async_mqtt.cpp.o
[100%] Linking CXX static library libasync_mqtt.a
[100%] Built target async_mqtt
make async_mqtt 68.22s user 0.78s system 99% cpu 1:09.23 total
async_mqtt (separate-compilation-mode) user code part
time make check_async_mqtt_separate
[ 50%] Built target async_mqtt
[ 75%] Building CXX object CMakeFiles/check_async_mqtt_separate.dir/src/check_async_mqtt_separate.cpp.o
[100%] Linking CXX executable check_async_mqtt_separate
[100%] Built target check_async_mqtt_separate
make check_async_mqtt_separate 16.38s user 0.38s system 99% cpu 16.826 total
Memory consumption size optimization (-Os)
async-mqtt5 (header-only)
/usr/bin/time -v ./check_async-mqtt5
Command being timed: "./check_async-mqtt5"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 66%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 4324
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 184
Voluntary context switches: 8
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
async_mqtt (header-only)
/usr/bin/time -v ./check_async_mqtt
Command being timed: "./check_async_mqtt"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 66%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 4660
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 184
Voluntary context switches: 9
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
async_mqtt (separate-compilation-mode)
/usr/bin/time -v ./check_async_mqtt_separate
Command being timed: "./check_async_mqtt_separate"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 66%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 5376
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 195
Voluntary context switches: 9
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0