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

Core: Reduce unnecessary add operations in deletedPaths set #8868

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

bknbkn
Copy link
Contributor

@bknbkn bknbkn commented Oct 18, 2023

This change will make deletedPaths call 'add' function only if it not contains file path, thus avoiding the unnecessary cost caused by 'add' function calls

@github-actions github-actions bot added the core label Oct 18, 2023
@bknbkn
Copy link
Contributor Author

bknbkn commented Oct 19, 2023

cc @RussellSpitzer. @rdblue. @aokolnychyi, may I request your assistance in enabling workflows approval? Thanks for your time.

@RussellSpitzer
Copy link
Member

Not sure I understand this change. Seems like you are removing an optimization to avoid re computing whether a path is deleted if we already determined it is deleted?

@bknbkn
Copy link
Contributor Author

bknbkn commented Oct 20, 2023

Not sure I understand this change. Seems like you are removing an optimization to avoid re computing whether a path is deleted if we already determined it is deleted?

In the original code, the deletedPath.add() function is called regardless of whether the path is already in the deletedPath set. I think it only needs to be called when the path is not in the deletedPath set, if the path is already in the deletedPath set, calling the deletedPath.add() function will add nothing and is also unnecessary.

@RussellSpitzer
Copy link
Member

What about the check on 422?

@bknbkn
Copy link
Contributor Author

bknbkn commented Oct 20, 2023

What about the check on 422?

sorry, I made a mistake in the previous comment. The change is about deletedPath, not deletePath, and only affects the code starting from line 443. It has been corrected now. Please take another look.

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

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

This change looks good to me

@amogh-jahagirdar amogh-jahagirdar merged commit aa891ac into apache:main Oct 25, 2023
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants