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

perf(hw_interface): write packet data directly into the message #102

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Dec 4, 2023

PR Type

  • Improvement

Related Links

None.

Description

Before this change, in the driver, every time a UDP packet is received, it is first written to a std::array object, then copied into the message.
With this change, the UDP packets are directly read into the message, avoiding the overhead.

Their types are the same so it won't cause an issue.

Small note: also made the buffer size variable const since it doesn't change over time.

Review Procedure

You could:

  • double check the types.
  • test on pcap data.

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

@codecov-commenter
Copy link

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a89c0a9) 8.28% compared to head (22811ea) 3.96%.

Files Patch % Lines
.../nebula_hesai_hw_interfaces/hesai_hw_interface.cpp 0.00% 1 Missing ⚠️
...a_velodyne_hw_interfaces/velodyne_hw_interface.cpp 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #102      +/-   ##
========================================
- Coverage   8.28%   3.96%   -4.32%     
========================================
  Files         87      27      -60     
  Lines       8454    5946    -2508     
  Branches     853     463     -390     
========================================
- Hits         700     236     -464     
+ Misses      7178    5298    -1880     
+ Partials     576     412     -164     
Flag Coverage Δ
differential 3.96% <0.00%> (?)
total ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mojomex mojomex requested review from mojomex December 5, 2023 03:25
@mojomex
Copy link
Collaborator

mojomex commented Dec 5, 2023

Confirmed working on VLP32 and Pandar40P

@drwnz drwnz self-requested a review December 5, 2023 05:19
Copy link
Collaborator

@drwnz drwnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xmfcx, looks good!

@mojomex mojomex changed the title feat(hw_interface): write packet data directly into the message perf(hw_interface): write packet data directly into the message Dec 5, 2023
@mojomex mojomex merged commit 9b239c6 into tier4:main Dec 5, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants