Skip to content

Commit

Permalink
perf: add proxy cache to avoid the deserialize step (AimRT#140)
Browse files Browse the repository at this point in the history
* perf: add proxy cache to avoid the deserialize step

* feat(proxy_plugin): Dynamically register cache serialization types

* feat: Optimize the traversal method for type list
  • Loading branch information
yglsaltfish committed Jan 2, 2025
1 parent dc12c01 commit 2177637
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugins/proxy_plugin/proxy_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ void ProxyPlugin::RegisterSubChannel() {
.topic_name = topic_meta.topic_name,
.pkg_path = type_support_wrapper.options.path,
.module_name = "core",
.msg_type_support_ref = type_support_wrapper.type_support_ref},
.require_cache_serialization_types = {"pb", "ros2", "json", "yaml"}};
.msg_type_support_ref = type_support_wrapper.type_support_ref}};

for (const auto type_list = type_support_wrapper.type_support_ref.SerializationTypesSupportedListSpan(); const auto& type : type_list) {
subscribe_wrapper.require_cache_serialization_types.emplace(type.str);
}

subscribe_wrapper.callback = [this, action_raw_ptr = proxy_action.get()](
MsgWrapper& msg_wrapper, std::function<void()>&& release_callback) {
Expand Down

0 comments on commit 2177637

Please sign in to comment.