Skip to content

perf: early exit for pathIsInfolder (19% faster)#732

Merged
shetzel merged 10 commits intoforcedotcom:mainfrom
lukecotter:perf-early-exit-pathisinfolder
Jul 15, 2025
Merged

perf: early exit for pathIsInfolder (19% faster)#732
shetzel merged 10 commits intoforcedotcom:mainfrom
lukecotter:perf-early-exit-pathisinfolder

Conversation

@lukecotter
Copy link
Contributor

@lukecotter lukecotter commented Jan 17, 2025

What does this PR do?

pathIsInfolder will exit as early as possible,.
This improved overall sf project deploy start times in my project by ~19%

What issues does this PR fix or reference?

Combined with this pull request in isomorphic git I was seeing roughly 45 - 50% faster times working out the changed files to deploy.
there are also some general improvements

If it is accepted it would be great to upgrade that too.
Do you want me to create an issue on the issues repo?

@lukecotter lukecotter requested a review from a team as a code owner January 17, 2025 17:59
@lukecotter lukecotter changed the title perf: early exit for pathisinfolder perf: early exit for pathIsInfolder (19% faster) Jan 17, 2025
Will now pre process filePaths and group them by their packagedirectory.
This prevents the same file being checked for inclusion in a directory
when it has already been included in a previous directory.
@cristiand391
Copy link
Member

hi @lukecotter

thanks for the PR!
please ping me when your iso-git PR is released and I can get the e2e run on this PR 👍🏼

@lukecotter
Copy link
Contributor Author

@cristiand391
Copy link
Member

thanks @lukecotter!
I'll try to take a look next week.

@cristiand391 cristiand391 self-assigned this Mar 20, 2025
@lukecotter
Copy link
Contributor Author

@cristiand391 Now that v1.30.1 of isomorphic git has been adopted in #760 it would be great to get this in too so that the upstream sf cli libraries can benefit from both sets of performance improvements.

@lukecotter
Copy link
Contributor Author

Hi @cristiand391 and @WillieRuemmele is there anything you need from me to get this merged?

@shetzel
Copy link
Collaborator

shetzel commented Jun 16, 2025

@lukecotter - Can you please update the @salesforce/source-deploy-retrieve and @salesforce/core dependencies to be the latest versions? That is why the external tests are failing. I would do it for you but I can't push to your branch. That should get the tests passing and then we can merge this. Thanks for the contribution and sorry for the delay!

Also, please add unit tests for the code changes.

@lukecotter
Copy link
Contributor Author

@shetzel
Sorry been away. I merged in main so should have latest core and deploy-retrieve.

This is just a perf refactor so existing tests should cover everything as there is not behaviour change. I can have a look and cover any missing test cases though.

@lukecotter
Copy link
Contributor Author

@shetzel tests added too.

…retrieve to 12.21.1

- @salesforce/core: 8.15.0 -> 8.18.1
- @salesforce/source-deploy-retrieve 12.20.1 -> 12.21.1
@lukecotter
Copy link
Contributor Author

@shetzel
Also updated @salesforce/source-deploy-retrieve and @salesforce/core to latest so hopefully those tests pass now.

@shetzel shetzel merged commit bb3854a into forcedotcom:main Jul 15, 2025
15 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants