Closed furushchev closed 1 year ago
Loading this module is slow especially on a machine with slow disk i/o. I briefly profiled importing this library and found that the most of time is consumed on the initialization of the FlitePlugin class. https://github.com/ros-drivers/audio_common/blob/master/sound_play/src/sound_play/flite_plugin.py#L17-L20 And as the class is initialized on the toplevel ( __init__.py ), this affects importing any class in this module. https://github.com/ros-drivers/audio_common/blob/master/sound_play/src/sound_play/__init__.py#L34
FlitePlugin
__init__.py
@furushchev Thank you! The problem is that rospack is super slow for initialization.
rospack
As app_manager, we can share rospack object and make the package faster. https://github.com/PR2/app_manager/pull/52
app_manager
Loading this module is slow especially on a machine with slow disk i/o. I briefly profiled importing this library and found that the most of time is consumed on the initialization of the
FlitePlugin
class. https://github.com/ros-drivers/audio_common/blob/master/sound_play/src/sound_play/flite_plugin.py#L17-L20 And as the class is initialized on the toplevel (__init__.py
), this affects importing any class in this module. https://github.com/ros-drivers/audio_common/blob/master/sound_play/src/sound_play/__init__.py#L34