Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fasten rosversion --all #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tkmtnt7000
Copy link

Faster rosversion --all.
The following is a comparison of execution times using pyinstrument.

  • before (60.303s)
Program: /usr/bin/rosversion --all

60.303 main  rospkg/rosversion.py:95
└─ 60.235 get_version_from_package_name  rospkg/rosversion.py:72
   ├─ 30.819 get_path  rospkg/rospack.py:199
   │  └─ 30.819 _update_location_cache  rospkg/rospack.py:173
   │     └─ 30.811 list_by_path  rospkg/rospack.py:49
   │        ├─ 13.546 __init__  xml/etree/ElementTree.py:607
   │        │     [12 frames hidden]  xml, rospkg
   │        ├─ 10.886 walk  os.py:209
   │        │     [111 frames hidden]  os, rospkg, genericpath, stat, posixpath
   │        ├─ 3.090 [self]  
   │        └─ 2.749 find  xml/etree/ElementTree.py:694
   │              [18 frames hidden]  xml, rospkg
   └─ 29.178 get_stack_version  rospkg/rospack.py:421
      └─ 29.178 get_path  rospkg/rospack.py:199
         └─ 29.176 _update_location_cache  rospkg/rospack.py:173
            └─ 29.167 list_by_path  rospkg/rospack.py:49
               ├─ 13.520 __init__  xml/etree/ElementTree.py:607
               │     [12 frames hidden]  xml, rospkg
               ├─ 10.759 walk  os.py:209
               │     [110 frames hidden]  os, rospkg, genericpath, stat, posixpath
               ├─ 2.863 find  xml/etree/ElementTree.py:694
               │     [16 frames hidden]  xml, rospkg
               └─ 1.789 [self]  

  • after (24.152s)
Program: /usr/bin/rosversion --all

24.152 main  rospkg/rosversion.py:95
└  24.047 get_version_from_package_name  rospkg/rosversion.py:72
   ├─ 12.760 get_path  rospkg/rospack.py:207
   │  └─ 12.759 _update_location_cache  rospkg/rospack.py:181
   │     └─ 12.753 list_by_path  rospkg/rospack.py:51
   │        ├─ 8.706 walk  os.py:209
   │        │     [114 frames hidden]  os, rospkg, genericpath, stat, posixpath
   │        ├─ 1.972 find  xml/etree/ElementTree.py:694
   │        │     [18 frames hidden]  xml, rospkg
   │        └─ 1.695 [self]  
   └─ 11.072 get_stack_version  rospkg/rospack.py:429
      └─ 11.069 get_path  rospkg/rospack.py:207
         └─ 11.066 _update_location_cache  rospkg/rospack.py:181
            └─ 11.065 list_by_path  rospkg/rospack.py:51
               ├─ 8.408 walk  os.py:209
               │     [106 frames hidden]  os, rospkg, genericpath, stat, posixpath
               ├─ 1.936 find  xml/etree/ElementTree.py:694
               │     [16 frames hidden]  xml, rospkg
               └─ 0.527 [self] 

cc:@iory @708yamaguchi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant