-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Sketch re-compiled when unnecessary #1996
Comments
What's the status on this? I'm getting bit by this also. |
Actually the compile process does compile different "parts" of a sketch:
The first two already use a caching mechanism. The sketch currently does not have this behavior. Unfortunately, it's not that easy because the library detection can't be cached. |
can't? i don't think so. it's amazing how make has done this for decades. |
Just to give some context: the slow part is the automatic library detection, the difference between a Makefile and a sketch is that with a Makefile the used libraries are given (it's the user's duty to write the paths manually or with the aid of other tools like cmake/automake). With a sketch, the libraries are automatically discovered. Moving to a more pragmatic example, this is how a clean compile looks like:
and this is the same compile after immediately re-running it:
The second run is resuing almost everything from the cache except on:
About problem 2: this could be surely improved even if the gain is very little compared to the overall compilation time. I opened #2204 to track this one. About problem 1: there is an interesting tentative here #1735 but it's flaky, BTW it gave some ideas to work on to actually get to a correct solution, I made a preparatory PR here #1766 to clean up the library resolution code in preparation of a bigger refactoring. |
and i consider the automatic library detection a gimmick and unnecessary. as the author of the code i know exactly which libraries i'm using can can easily declare their use. have a faster, more efficient build is WAY more important than library detection. |
THIS IS SO ANNOYING. Really. Together with the exhaustive compilation times, not just on Windows, also on Linux for V. 2x - this is not acceptable. Wherever I can, I use now PlatformIO. Unfortunately, this is not possible with every Arduino project. This problem persists now a long time. Sorry - this can not be accepted. The Arduino IDE is for beginners and should not sugest, C compiling takes forever. I am doing programming now for a long time (decades), but I never saw such a poor implementation. Normally, I would not post such negative thoughts. But the problem is: this simple facts, which EVERY other IDE has solved for ages, still exists. |
@apos With Arduino CLI and IDE 2 we have brought these helpers into a more modern enhanced experience. Please consider @cmaglie 's above comments
I always try to highlight the reasons why some things take time or are not at all possible, and the fact is that we have a very small team (substantially 3 to 5 depending on other tasks) that works every day to make this better and address users' needs and suggestions. This is an Open-Source project and some users strive to submit PRs which require us to look into and figure out if they break 3 things to fix one. I consider myself an advanced user and I've had a few years on PlatformIO before joining the Arduino team. Sadly every category of user has to deal with some drawbacks. u. |
Describe the problem
When using make & makefiles a build followed immediately by another build causes nothing to be compiled or linked because make honors timestamps when building the dependency graph. The arduino-cli does not seem to do this. If i do a compile and then immediately another compile it rebuild the binary the second time. This is unnecessary and consumes time & processing power. Arduido-cli should behave like make.
To reproduce
Do a compile and the immediately another compile.
Expected behavior
The second compile should exit without doing anything.
Arduino CLI version
arduino-cli Version: 0.29.0 Commit: 76251df Date: 2022-11-17T09:21:37Z
Operating system
Windows
Operating system version
Windows 11
Additional context
Additional reports
Issue checklist
The text was updated successfully, but these errors were encountered: