Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iawia002
Copy link

@iawia002 iawia002 commented Oct 22, 2020

What this PR does / why we need it:

There are basically two changes: first, use packages.Load instead of build.Import to analyze a package, and second, import all packages at once rather than individually.

Take storage-admin project as an example, API document generation:

BeforeAfter
1110.53s user
1321.23s system
499% cpu
8:06.60 total
144.90s user
23.57s system
610% cpu
27.607 total

API client generation:

BeforeAfter
1070.64s user
1265.10s system
501% cpu
7:45.53 total
138.41s user
22.62s system
626% cpu
25.691 total

The average time reduced from 8 minutes to half a minute.

Which issue(s) this PR is related to (optional, link to 3rd issue(s)):

Fixes #

Reference to #

Special notes for your reviewer:

/cc @your-reviewer

/kind feature

Release note:

Use `packages.Load` instead of `build.Import` in API documentation/client generation to get better performance.

@caicloud-bot caicloud-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 22, 2020
@iawia002 iawia002 changed the title WIP: refactor(analyzer): use packages.Load instead of build.Import to get better performance refactor(analyzer): use packages.Load instead of build.Import to get better performance Oct 22, 2020
@caicloud-bot caicloud-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 22, 2020
@iawia002
Copy link
Author

/cc @xpofei

@xpofei
Copy link
Contributor

xpofei commented Oct 23, 2020

release note 填一下吧 😋

@caicloud-bot caicloud-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 23, 2020
@iawia002
Copy link
Author

release note 填一下吧 😋

Done

@xpofei
Copy link
Contributor

xpofei commented Oct 23, 2020

/lgtm

@caicloud-bot caicloud-bot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Oct 23, 2020
@xpofei
Copy link
Contributor

xpofei commented Oct 23, 2020

/lgtm

@caicloud-bot caicloud-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 23, 2020
@iawia002
Copy link
Author

/approve

@caicloud-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iawia002, xpofei

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@caicloud-bot caicloud-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 23, 2020
@caicloud-bot caicloud-bot merged commit ca969f3 into caicloud:master Oct 23, 2020
@iawia002 iawia002 deleted the re-analyzer branch October 23, 2020 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants