Skip to content

[skip changelog] Sliglthly optimize searchConfigTree #515

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

Merged
merged 1 commit into from
Dec 13, 2019
Merged

Conversation

masci
Copy link
Contributor

@masci masci commented Dec 13, 2019

This PR optimize searchConfigTree to speed up performance on Windows, where it was particularly slow.

// no config file found
next := path.Join(cwd, "..")
if filepath.Clean(next) == filepath.Clean(cwd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a quick profiling session it seems that on Windows the filepath.Clean() was responsible for the performance degradation. Removing this check fixed the CLI slow response (even with the version command) in case of missing arduino-cli.yaml configuration file on the machine.

Copy link
Contributor

@rsora rsora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masci masci merged commit cf39fbe into master Dec 13, 2019
@masci masci deleted the massi/configtree branch December 13, 2019 14:07
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.

2 participants