Ai perf improvement / Fix perf regressions from key support#581
Open
jmachowinski wants to merge 5 commits into
Open
Ai perf improvement / Fix perf regressions from key support#581jmachowinski wants to merge 5 commits into
jmachowinski wants to merge 5 commits into
Conversation
added 5 commits
April 10, 2026 18:14
| @@ -0,0 +1,54 @@ | |||
| // Copyright 2019 Rover Robotics via Dan Rose | |||
Contributor
There was a problem hiding this comment.
is this copyright generated by AI? where the heck is this come from? AI is just referring to some other source and copy it here???
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a vibe coded rewrite of the serialization, de serialization and size computation code.
This implementation is depending on the msg 2-3x faster in serialization and de serialization,
and about 10x faster in size computation. Note that the size computation must be done before
serialization, and was taking ~50% of the cpu time in the old implementation during publish.
The bottom line here is there more nested and complex the msg the faster the new implementation.
For 'bulk types' like images there is almost no difference.
With the performance roundtrip benchmarks, using marker arrays, I can see a CPU time reduction
from ~60% to ~16%. The time it takes to call publish and CPU time usage is now close to the one of
fastRTPS.
Fixes # (issue)
Performance regressions introduced with the key support patches.
Is this user-facing behavior change?
No
Did you use Generative AI?
Yes, this is completely vibe coded.
Additional Information
All tests in test_communication are passing.
As to why this is actually faster:
the types that must be loaded while traversing the data bigger. I was suspecting cache line issues, as some experiments showed, that the speed was sensitive to the size of the types of type system.
Note, there are still 2 places in the rmw_node implementation were the old type system is used.
I must say I am a bit torn about this. I don't fully trust AI written code, and I must admit this is a code bomb drop.
On the other hand the benchmark result speak for themself.
I wonder how we should go forward with this ?
@eboasson @mjcarroll Opinions ?