Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvements #151

Merged
merged 4 commits into from
Feb 8, 2023
Merged

Performance improvements #151

merged 4 commits into from
Feb 8, 2023

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Feb 8, 2023

Public-Facing Changes

  • Minor performance improvements

Description
This PR makes some minor performance improvements:

  • Use websocketpp::endpoint< connection, config >::send(connection_hdl hdl, message_ptr msg)
  • Use fixed size std::array<uint8_t, N> to avoid heap allocation
  • Avoid some unnecessary conversions

To measure performance improvments, I wrote a test client that prints some channel statistics: foxglove/ws-protocol#361. The table below shows the average CPU time and data received (over 4 runs) when playing back realsense-ros2-001.mcap:

main (8e08af0) This PR Difference
total data received [kb] 3308866.3 3299419.4 -0.29%
CPU time [s] 17.75 15.25 -14.08%

We can see that this PR significantly reduces CPU load while the data throughput remains almost the same (statistically speaking probably not significantly different)

@achim-k achim-k merged commit 0354ccd into main Feb 8, 2023
@achim-k achim-k deleted the achim/performance_improvements branch February 8, 2023 17:51
achim-k added a commit that referenced this pull request Feb 13, 2023
**Public-Facing Changes**
- Add option to use permessage-deflate compression


**Description**
- Add option to use permessage-deflate compression

Found out that this was possible when implementing #151. Not sure if it
is really useful tho, the additional CPU load is quite high (I can
provide some measurements on request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants