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

Remove unused build output buffer #4786

Merged
merged 3 commits into from
Nov 16, 2023
Merged

Remove unused build output buffer #4786

merged 3 commits into from
Nov 16, 2023

Conversation

rgov
Copy link
Contributor

@rgov rgov commented Nov 14, 2023

In verbose mode, output from the build command was constantly being appended to an unused buffer, character by character. Even a simple project using ESP-IDF would generate over 5 million append operations, which is quite slow because the backing memory for this buffer has to be constantly reallocated.

The actual buffer that's used is the local line variable. An alternative fix would be to remove line and use self._buffer instead, so that the get_buffer() method will return the buffer contents.

Time to compile
Baseline (non-verbose) 22.97 seconds
Before patch (verbose) 1722.01 seconds
After patch (verbose) 24.23 seconds

Fixes #4783.

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2023

CLA assistant check
All committers have signed the CLA.

@ivankravets ivankravets merged commit f70e6d5 into platformio:develop Nov 16, 2023
0 of 36 checks passed
@ivankravets
Copy link
Member

Thanks for the PR!

@ivankravets ivankravets added this to the 6.1.12 milestone Nov 16, 2023
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.

Verbose build takes 75x as long as regular build
3 participants