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

reduce file access #4461

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Bananeweizen
Copy link
Contributor

At least on Windows the repeated invocation of file.exists takes a huge amount of time. The change removes several minutes of runtime from a 1 hour product build:
image

At least on Windows the repeated invocation of file.exists takes a huge
amount of time.
@@ -68,10 +68,13 @@ public File getLocation(boolean fetch) {
if (projectLocation != null) {
return projectLocation;
}
if (fetch && locationSupplier != null && (location == null || !location.exists())) {
if (fetch && locationSupplier != null && location == null) {
Copy link
Member

Choose a reason for hiding this comment

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

The check was there to make sure the file was not deleted in the meantime (e.g. outside of control of the descriptor), this won't be detected anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm aware of that. But I believe the improved performance is totally worth that. Also, if this is related to the "file is corrupt, trigger download again" functionality, then I think we should do something there were the download is re-triggered. here it really costs far too much. In the above screenshot it's 6 minutes in this single method call.

Copy link
Member

Choose a reason for hiding this comment

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

Also, if this is related to the "file is corrupt, trigger download again" functionality, then I think we should do something there were the download is re-triggered

The problem is that it is not that easy. We know that the file is corrupt (and can delete it) but there is no easy way to know here it was downloaded from.

Copy link

Test Results

  603 files    603 suites   4h 4m 21s ⏱️
  431 tests   424 ✅  7 💤 0 ❌
1 293 runs  1 271 ✅ 22 💤 0 ❌

Results for commit 880caa4.

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.

2 participants