colcon-core icon indicating copy to clipboard operation
colcon-core copied to clipboard

[Question] colcon list slow ?

Open harleylara opened this issue 2 years ago • 2 comments

I was wondering if colcon list is slow or is it something in my system that makes it slow?... I find it interesting that a workspace with a single empty package takes more than a second to return the list.

user@laptop:~/ros2_ws $ time colcon list
empty_python    src/empty_python        (ros.ament_python)

real    0m1.633s
user    0m0.895s
sys     0m0.229s

Is there anything that can be done about this?.... here is some additional information, thanks 😄

System information:

OS: Ubuntu 20.04.6 LTS
CPU: Intel i7-10750H
Memory: 8GB
ROS distro: Foxy

harleylara avatar Jul 31 '23 12:07 harleylara

That's certainly pretty slow.

You might try using a tool like flameprof to figure out which Python functions are taking so long: python3 -m flameprof -o colcon_list.svg -m colcon list

cottsay avatar Jul 31 '23 16:07 cottsay

it seems to be executing the _find_and_load function multiple times.

colcon_list

I do not know much about the internal architecture of colcon clearly I can not give at this moment a more precise interpretation ... sorry for that 🤣

harleylara avatar Aug 01 '23 11:08 harleylara