colcon / colcon-core

Command line tool to build sets of software packages
http://colcon.readthedocs.io
Apache License 2.0
103 stars 46 forks source link

[Question] colcon list slow ? #565

Open harleylara opened 1 year ago

harleylara commented 1 year ago

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
cottsay commented 1 year ago

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

harleylara commented 1 year ago

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 🤣