Bug 572338

Summary: DefaultHandler.java should should reduce number of file accesses
Product: [Eclipse Project] Platform Reporter: Carsten Hammer <carsten.hammer>
Component: ResourcesAssignee: Carsten Hammer <carsten.hammer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Lars.Vogel, loskutov
Version: 4.20Keywords: performance
Target Milestone: 4.22 M1   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/175921
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=7c4abd208b2ab780f54d945015d3e2c36281cf24
https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/185328
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=761bae43648ca369406e0934df21f388564bcb25
https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/185973
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=2c4c76bb394e289b6647467c0b0aa265c427676c
Whiteboard:

Description Carsten Hammer CLA 2021-03-26 11:51:29 EDT
org/eclipse/core/internal/filesystem/local/nio/DefaultHandler.java accesses currently 4 times the file while one time using a bulk access was enough:

instead of 

Files.isSymbolicLink(path)
Files.getLastModifiedTime(path)
Files.size(path)
Files.isDirectory(path)

one call to 

Files.readAttributes(path, BasicFileAttributes.class);

should be faster (especially when using a anti virus software)
Comment 2 Lars Vogel CLA 2021-09-10 04:07:46 EDT
Thanks Carsten for the change and Jörg and Karsten for the review.
Comment 3 Eclipse Genie CLA 2021-09-11 03:30:25 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/185328
Comment 5 Eclipse Genie CLA 2021-09-30 08:00:26 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/185973
Comment 7 Andrey Loskutov CLA 2021-10-01 10:51:09 EDT
(In reply to Eclipse Genie from comment #6)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/185973 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/
> ?id=2c4c76bb394e289b6647467c0b0aa265c427676c

Ignore that, was for other bug.