-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: Fixed has target check taking ages for large projects #138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading https://stackoverflow.com/questions/23849953/how-to-check-existence-of-the-target-in-a-makefile, I'm wondering if we shouldn't also use --dry-run
and maybe use the strategy suggested there where we check the output of the data base with --print-data-base
? I'm not certain it provides more benefits, but maybe it would help to avoid unintended (and in some cases expensive time-wise) side effects.
With that suggestion aside, there's just a few small technical questions and requests before this is lgtm.
I tested this on macos and I didn't notice or see any issues building the |
I had some issues with this patch, it does not seem to work in special situations. |
What sort of behavior does this exhibit if the CMake generator is Visual Studio? Also, what if the system's language is not set to English - is |
Unchanged
AFAIK make is not localized, at least it is not on my german localized ubuntu |
65b9d43
to
fb4368a
Compare
--dry-run generated a lot of not needed output, which is not done by the question mode. As I don't check on the return code, but parse the std_err instead, we should be fine |
This version is working, and tested. Additional tests would be appreciated though, as I only have a linux machine. |
Beyond the linting errors that CI identified, I am also concerned that this change is coupled to GNU Make. The That said, BSD isn't an explicitly supported platform, but it still doesn't feel good to break it just for an optimization. I'll do a little more poking around to see if I can see another solution. |
@cottsay ping |
It looks like the It appears to be a lot faster than |
I just testet -n vs -q , on our system -n seems to be slower but its still a major improvement over the current state : Starting >>> cm_interfaces
Finished <<< cm_interfaces [2.87s]
Summary: 1 package finished [3.59s]
Starting >>> cm_interfaces
Finished <<< cm_interfaces [2.93s]
Summary: 1 package finished [3.67s] with -q Starting >>> cm_interfaces
Finished <<< cm_interfaces [4.61s]
Summary: 1 package finished [5.34s]
Starting >>> cm_interfaces
Finished <<< cm_interfaces [5.41s]
Summary: 1 package finished [6.14s]
Starting >>> cm_interfaces
Finished <<< cm_interfaces [4.56s]
Summary: 1 package finished [5.29s] I still wonder, about the impact of the text output in colcon though... time make -q install
real 0m0,343s
user 0m0,330s
sys 0m0,011s time make -n install
real 0m0,960s
user 0m0,812s
sys 0m0,142s The time spend in make increases only about 600ms, vs 1.6 seconds in colcon. |
The old implementation took up to 30 seconds for packages, were a lot of targets existed. This is a common case for interface packages containing a lot of messages. Signed-off-by: Janosch Machowinski <[email protected]>
fb4368a
to
5ca3725
Compare
Let's try a completely different approach: #144 This appears to be significantly faster even for medium-sized projects. Please give it a shot on your large project. You may need to pass |
Glad it worked well for you. This actually happens twice for ROS projects, which is probably why the timing you see coming from colcon is so different from the raw To be honest, the bespoke code snippets for the individual generators have grown pretty long-in-tooth and we're performing FAR too many process invocations during each CMake build. Most if not all of the information we need to collect from those invocations is part of the codemodel file API, so there may be a small refactor in the near future to shave off some more time from CMake jobs like this. |
The old implementation took up to 30 seconds for packages, were a lot of targets existed. This is a common case for interface packages containing a lot of messages.