Skip to content

Use hash map for rcl_params_t and rcl_node_params_s #808

@iuhilnehc-ynos

Description

@iuhilnehc-ynos

Feature request

Feature description

Currently, find_node and find_parameter use a loop find with an array to get an item which costs O(n), it's better to use a hash map instead of the array to store data so that it will costs O(1).

Implementation considerations

typedef struct rcl_node_params_s
{
  rcutils_hash_map_t params;      /// char* : rcl_variant_t*
} rcl_node_params_s;

typedef struct rcl_params_s
{
  rcutils_hash_map_t node_params; /// char* : rcl_node_params_t*
  rcutils_allocator_t allocator;  ///< Allocator used
} rcl_params_t;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions