Skip to content

Add thread-local TypeSupport cache to rmw_serialize/deserialize#866

Draft
mjcarroll wants to merge 3 commits intoros2:rollingfrom
mjcarroll:pr/thread-local-typesupport-cache
Draft

Add thread-local TypeSupport cache to rmw_serialize/deserialize#866
mjcarroll wants to merge 3 commits intoros2:rollingfrom
mjcarroll:pr/thread-local-typesupport-cache

Conversation

@mjcarroll
Copy link
Member

@mjcarroll mjcarroll commented Mar 5, 2026

This PR adds a thread_local MessageTypeSupport_cpp and TypeSupportCache to rmw_serialize and rmw_deserialize. It eliminates per-call hash-map lookup and mutex overhead, significantly improving performance for small and high-frequency messages.

Generated with the help of Claude Sonnet 4.6

Michael Carroll added 3 commits March 5, 2026 07:26
- Implemented thread_local MessageTypeSupport_cpp and TypeSupportCache
- Eliminates per-call hash-map lookup and mutex overhead
- Significantly improves performance for small and high-frequency messages
- Implemented thread_local MessageTypeSupport_cpp and TypeSupportCache
- Eliminates per-call hash-map lookup and mutex overhead
- Significantly improves performance for small and high-frequency messages
Copy link
Collaborator

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

Very nice optimization!

Sadly, DCO needs to be fixed

@christophebedard christophebedard marked this pull request as draft March 12, 2026 16:43
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.

3 participants