-
-
Notifications
You must be signed in to change notification settings - Fork 792
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
Verbose build takes 75x as long as regular build #4783
Comments
Hi @rgov, that's somewhat expected. IDF has hundreds of source files with huge compile commands and every print to the terminal requires some additional processing time. As a workaround just redirect the output to a file |
I am pretty certain there is a bug here. You can build any number of large programs with verbose output and it does not take 75x as long. The huge compile commands are already constructed in memory, printing them to the terminal takes milliseconds. If it took 5% longer I wouldn't even notice. Even if verbose build disabled parallel compilation, I would expect like 8x as long to build not 75x as long. |
The underlying SCons call on my system when I run
This completes the build in about 20 seconds just like the non-verbose build. Therefore I think the slowdown involves the buffering of output that platformio does. |
@rgov thanks for the report. We will fix this issue in PlatformIO Core 7.0 (leveraging asyncio for subprocessing). |
@ivankravets See pull request #4786, it's a very simple fix. |
Did it help you? |
Yes, I posted a benchmark showing the issue is resolved. The problem is a buffer that grows unbounded and is reallocated and copied over and over again. At about 2 MB the behavior of this operation in CPython seems to slow down tremendously. |
Thanks! Please re-test with the latest dev-branch ( |
Configuration
Operating system: macOS 14.1.1 (arm64)
PlatformIO Version: PlatformIO Core, version 6.1.11
Description of problem
Building my project with
--verbose
significantly increases the time to build.Steps to Reproduce
I have a very minimal project based on
espidf
:platformio.ini
Building regularly:
Building verbosely:
The text was updated successfully, but these errors were encountered: