Skip to content

Speed up path checking#1120

Closed
PaulTaykalo wants to merge 1 commit intoyonaskolb:masterfrom
PaulTaykalo:fix/improve-speed-of-path-checking
Closed

Speed up path checking#1120
PaulTaykalo wants to merge 1 commit intoyonaskolb:masterfrom
PaulTaykalo:fix/improve-speed-of-path-checking

Conversation

@PaulTaykalo
Copy link
Copy Markdown
Contributor

@PaulTaykalo PaulTaykalo commented Aug 25, 2021

For checking if path is subpath of another, we don't actually need to use contains method.
hasPrefix will do all the job and will be faster to check.

This is because in the method, when we're checking paths, we're operating with full path's, so using contains is not only slower, but can also get false positives in some rare cases

Using this fix only, decreased project generation from about 14s to 5s on my project.

Before

image

After

image

@PaulTaykalo
Copy link
Copy Markdown
Contributor Author

#1122 makes this PR irrelevant

@PaulTaykalo PaulTaykalo closed this Sep 9, 2021
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.

1 participant