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

[lcmtypes] Add benchmark #22480

Merged

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Jan 17, 2025

Towards #20761 and therefore towards #17231 and #21868.

The objective here is to have sufficient benchmark coverage that we feel confident switching over the implementation.

Sample output:

----------------------------------------------------------------------------------
Benchmark                              Time             CPU    Allocs   Iterations
----------------------------------------------------------------------------------
LcmFixture/ImageArrayEncode         82.9 us         82.9 us     1.375         7994
LcmFixture/ImageArrayDecode         80.1 us         80.1 us    3.4375         8633
LcmFixture/PandaCommandEncode       29.6 ns         29.6 ns      1.25     24645732
LcmFixture/PandaCommandDecode       3.28 ns         3.28 ns    0.3125    216860095
LcmFixture/PandaStatusEncode        71.0 ns         71.0 ns     1.625      9747702
LcmFixture/PandaStatusDecode        3.12 ns         3.12 ns    0.6875    224399289
LcmFixture/ViewerDrawEncode         4.84 us         4.84 us   95.3125       144837
LcmFixture/ViewerDrawDecode         3.12 ns         3.12 ns    94.375    224434971

This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: low release notes: none This pull request should not be mentioned in the release notes labels Jan 17, 2025
@jwnimmer-tri
Copy link
Collaborator Author

+@sammy-tri this seems like it might be up your alley for feature review?

Copy link
Contributor

@sammy-tri sammy-tri left a comment

Choose a reason for hiding this comment

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

Will review.

Reviewable status: LGTM missing from assignee sammy-tri(platform), needs at least two assigned reviewers

Copy link
Contributor

@sammy-tri sammy-tri left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: needs at least two assigned reviewers

@jwnimmer-tri
Copy link
Collaborator Author

+@xuchenhan-tri for platform review, please (tomorrow).

Copy link
Contributor

@xuchenhan-tri xuchenhan-tri left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: 1 unresolved discussion


lcmtypes/benchmarking/benchmark.cc line 78 at r1 (raw file):

      message.position[i].resize(3, 0);
      message.quaternion[i].resize(4, 0);
    }

nit, this seems redundant since the values are already set to zero in the resize above.

Code quote:

    for (int i = 0; i < n; ++i) {
      message.position[i].resize(3, 0);
      message.quaternion[i].resize(4, 0);
    }

@jwnimmer-tri jwnimmer-tri force-pushed the lcmtype-conversion-benchmark branch from 5b1e51e to 66f5ea4 Compare January 22, 2025 18:06
@jwnimmer-tri jwnimmer-tri force-pushed the lcmtype-conversion-benchmark branch from 66f5ea4 to 7d5d2cf Compare January 22, 2025 18:06
Copy link
Contributor

@sammy-tri sammy-tri left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees sammy-tri(platform),xuchenhan-tri(platform)

Copy link
Contributor

@xuchenhan-tri xuchenhan-tri left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees sammy-tri(platform),xuchenhan-tri(platform)

@jwnimmer-tri jwnimmer-tri merged commit 2876943 into RobotLocomotion:master Jan 22, 2025
5 of 10 checks passed
@jwnimmer-tri jwnimmer-tri deleted the lcmtype-conversion-benchmark branch January 22, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low release notes: none This pull request should not be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants