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

Log event for slow glob evaluation so VS can alert users #3204

Open
Pilchie opened this issue Apr 17, 2018 · 4 comments
Open

Log event for slow glob evaluation so VS can alert users #3204

Pilchie opened this issue Apr 17, 2018 · 4 comments
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Engine Issues impacting the core execution of targets and tasks. performance Performance-Scenario-Solution-Open This issue affects solution open performance. Priority:1 Work that is critical for the release, but we could probably ship without
Milestone

Comments

@Pilchie
Copy link
Member

Pilchie commented Apr 17, 2018

We've seen several reports from customers where glob evaluation has severely affected VS performance:

  1. One customer with ~600 projects and ~200,000 files had a glob in a targets file imported by all projects that looked for files from the root, accounting for 6s out of a total of 8s of evaluation time while loading the solution.
  2. It's not uncommon for internal customers to have globs that are rooted by an env var - then when they open in VS without that env var set, the evaluation end up being rooted at \ and takes forever.

We discussed mitigations for this, and it would be nice if MSBuild could log an event once evaluation has takes more than a certain threshold (ideally including which glob it was and where it was rooted). Then VS could hook that up to a perf tip.

@Pilchie
Copy link
Member Author

Pilchie commented Apr 17, 2018

Options considered:

a. Specific logging of globs and if it goes over a certain threshold (or always? too much overhead)
b. Can we remember that evaluation was slow and turn on the evaluation profiler the second time?
c. Turn on profiling by defualt in a low-overhead mode which times every operation, but only records the info if it's over a certain amount of time. Can we do this in a low-enough overhead fashion?

We picked a, because we suspect that globs will be by far the most likely offender.

@rainersigwald rainersigwald added this to the MSBuild 15.8 milestone Apr 17, 2018
@rainersigwald rainersigwald added Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. performance Area: Engine Issues impacting the core execution of targets and tasks. labels Apr 17, 2018
@danmoseley
Copy link
Member

BTW @rainersigwald is there an issue to have MSBuild take advantage of the faster file enumeration .API's shipping in .NET Core 2.1 ?

@rainersigwald
Copy link
Member

@cdmihai ^ do we have a bug for that? I know you worked on the design . . .

@rokonec
Copy link
Contributor

rokonec commented Jan 9, 2024

@JanKrivanek please consider for analyzers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Engine Issues impacting the core execution of targets and tasks. performance Performance-Scenario-Solution-Open This issue affects solution open performance. Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

No branches or pull requests

7 participants