Skip to content

Commit 13d6e1e

Browse files
authored
cache lookup of importlib metadata in Node action (#365)
* cache lookup of importlib metadata in Node action Signed-off-by: William Woodall <[email protected]> * style fixup Signed-off-by: William Woodall <[email protected]> --------- Signed-off-by: William Woodall <[email protected]>
1 parent 02b3836 commit 13d6e1e

File tree

1 file changed

+7
-1
lines changed
  • launch_ros/launch_ros/actions

1 file changed

+7
-1
lines changed

launch_ros/launch_ros/actions/node.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,15 @@ def instantiate_extension(
559559
return extension_instance
560560

561561

562+
g_entry_points_impl = None
563+
564+
562565
def get_extensions(logger):
566+
global g_entry_points_impl
563567
group_name = 'launch_ros.node_action'
564-
entry_points_impl = importlib_metadata.entry_points()
568+
if g_entry_points_impl is None:
569+
g_entry_points_impl = importlib_metadata.entry_points()
570+
entry_points_impl = g_entry_points_impl
565571
if hasattr(entry_points_impl, 'select'):
566572
groups = entry_points_impl.select(group=group_name)
567573
else:

0 commit comments

Comments
 (0)