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

Split GitCommitProvider and move LoadCommits from prebuild to file build #3705

Merged
merged 9 commits into from
Dec 4, 2018

Conversation

OsmondJiang
Copy link
Contributor

@OsmondJiang OsmondJiang commented Nov 30, 2018

  1. split git commit provider and git commit cache provider
  2. combine repository provider and git commit provider
  3. save git commit cache at the end of the build
  4. remove contribution provider load, make it as inner call of build page, no need to load commits before build
  5. make the git commit provider lifetime consistent with build, be able to be re-used everywhere during one build
  6. Fixes git commit provider is not thread safe #3700

Copy link
Contributor

@superyyrrzz superyyrrzz left a comment

Choose a reason for hiding this comment

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

:shipit:

@yufeih
Copy link
Contributor

yufeih commented Nov 30, 2018

What is the peak memory usage and build time after this change for azure-docs-pr? This is performance sensitive code so I want to know some numbers.

@yufeih yufeih changed the title improve a little bit of git commit provider Split GitCommitProvider and move LoadCommits from prebuild to file build Nov 30, 2018
@OsmondJiang
Copy link
Contributor Author

OsmondJiang commented Dec 3, 2018

i will test it using my local machine

The peak memory is 5.5 GB, bigger than the preview way because now the loadCommits are inner call of build page, not a preview step, so the "tree" cache keeps in the memory until the build finished:

image

The build files time:

  • with cache:(under 1G)
    • build files: 44s
    • convert legacy 1:22s
  • without cache:(5.5G)
    • build files: 2:52s
    • legacy 1:30

And we find an interesting problem, the gitCommitProvider will not be GC until build although it's an variable of buildFiles method, it seems referenced by ParallelUtility.Foreach, @yufeih, need your input here, please reference above picture

@OsmondJiang OsmondJiang force-pushed the optimization/git_commit_provider branch from 7fc1d9d to f7cb549 Compare December 3, 2018 02:24
@OsmondJiang OsmondJiang force-pushed the optimization/git_commit_provider branch 2 times, most recently from 2f24a31 to dabc6a6 Compare December 3, 2018 07:44
@OsmondJiang OsmondJiang force-pushed the optimization/git_commit_provider branch 2 times, most recently from b401577 to 66151b1 Compare December 3, 2018 09:01
@yufeih
Copy link
Contributor

yufeih commented Dec 4, 2018

The build files time:

  • with cache:(under 1G)

    • build files: 44s
    • convert legacy 1:22s
  • without cache:(5.5G)

    • build files: 2:52s
    • legacy 1:30

How does this compare to the result before this change?

@OsmondJiang OsmondJiang force-pushed the optimization/git_commit_provider branch from e48b42e to 93864f9 Compare December 4, 2018 02:08
Copy link
Contributor

@yufeih yufeih left a comment

Choose a reason for hiding this comment

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

👍

@OsmondJiang OsmondJiang merged commit 0d51430 into dotnet:v3 Dec 4, 2018
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.

4 participants