-
Notifications
You must be signed in to change notification settings - Fork 631
[rush] Optimize the execution speed of Rush #5007
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
Changes from 3 commits
2eb0665
1c4e825
12c0c46
493e2ab
238d1f3
75a0ad0
72940eb
6236ccd
4c094f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@microsoft/rush", | ||
"comment": "Optimize the execution speed of Rush", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@microsoft/rush" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@rushstack/package-deps-hash", | ||
"comment": "Optimize the execution speed of Rush", | ||
"type": "patch" | ||
L-Qun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
], | ||
"packageName": "@rushstack/package-deps-hash" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,8 @@ export class ProjectChangeAnalyzer { | |
*/ | ||
public async _tryGetSnapshotProviderAsync( | ||
projectConfigurations: ReadonlyMap<RushConfigurationProject, RushProjectConfiguration>, | ||
terminal: ITerminal | ||
terminal: ITerminal, | ||
projectSelection?: ReadonlySet<RushConfigurationProject> | ||
): Promise<GetInputsSnapshotAsyncFn | undefined> { | ||
try { | ||
const gitPath: string = this._git.getGitPathOrThrow(); | ||
|
@@ -295,10 +296,12 @@ export class ProjectChangeAnalyzer { | |
const lookupByPath: IReadonlyLookupByPath<RushConfigurationProject> = | ||
this._rushConfiguration.getProjectLookupForRoot(rootDirectory); | ||
|
||
const filterPath: string[] = Array.from(projectSelection ?? []).map((project) => project.projectFolder); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At minimum the choice to perform filtering needs to be behind a flag in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a configuration to determine whether to enable this feature. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @dmichon-msft, I've addressed the comments and made the updates. When you get a chance, could you please take another look? Thanks! |
||
|
||
return async function tryGetSnapshotAsync(): Promise<IInputsSnapshot | undefined> { | ||
try { | ||
const [hashes, additionalFiles] = await Promise.all([ | ||
getRepoStateAsync(rootDirectory, additionalRelativePathsToHash, gitPath), | ||
getRepoStateAsync(rootDirectory, additionalRelativePathsToHash, gitPath, filterPath), | ||
getAdditionalFilesFromRushProjectConfigurationAsync( | ||
additionalGlobs, | ||
lookupByPath, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,9 @@ const { hashDelimiter } = RushConstants; | |
*/ | ||
export interface IInputsSnapshot { | ||
/** | ||
* The raw hashes of all tracked files in the repository. | ||
* The raw hashes of the files relevant to the projects we care about are stored. | ||
* (e.g. when running `rush build`, the hashes of all tracked files in the repository are stored) | ||
* (e.g. when running `rush build --only`, only the hashes of files under the specified project are stored) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work. Computation of operation hashes depends on the entire tree of their dependencies, whether or not you are currently executing said dependencies. So at minimum we always need the expansion of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I just want to express that we are no longer storing all the hashes. I’ve removed that description. |
||
*/ | ||
readonly hashes: ReadonlyMap<string, string>; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.