Skip to content

Accelerate build context directory file walk#1442

Closed
swiedenfeld wants to merge 5 commits intodocker-java:masterfrom
swiedenfeld:improve-filewalk-performance
Closed

Accelerate build context directory file walk#1442
swiedenfeld wants to merge 5 commits intodocker-java:masterfrom
swiedenfeld:improve-filewalk-performance

Conversation

@swiedenfeld
Copy link
Contributor

This PR addresses the performance issue described in #1409.

#1412 has partially improved performance by memoizing frequently reused ignore patterns.
These commits now improve performance on my Windows 10 machine further by:

  • Use Java NIO Files.walk to efficiently walk the build context directory. It visits files and subdirectories in parallel and filters any items efficiently ignored
  • Use java.nio.file.Path#toUri instead of java.io.File#toUri, because it executes faster

With #1412 and these code changes, build context scans in my unit test setup (see #1412) on my Windows 10 machine now pass in about 6 seconds, while they previously used to take around 27 seconds.

java.nio.file.Path#toUri executes faster compared to java.io.File#toUri
@swiedenfeld
Copy link
Contributor Author

@bsideup I could use some input on this :)

@swiedenfeld
Copy link
Contributor Author

ping (before this goes stale)

@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@bsideup
Copy link
Member

bsideup commented Sep 27, 2020

@swiedenfeld sorry for letting it stale, I will try to find time and have a look at it soon!

@swiedenfeld
Copy link
Contributor Author

How can we proceed with this?

@swiedenfeld swiedenfeld deleted the improve-filewalk-performance branch July 14, 2021 19:32
@sp-ricard-valverde
Copy link

I wish this still was a thing

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.

3 participants