Bug 572338 - DefaultHandler.java should should reduce number of file accesses
Summary: DefaultHandler.java should should reduce number of file accesses
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.22 M1   Edit
Assignee: Carsten Hammer CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2021-03-26 11:51 EDT by Carsten Hammer CLA
Modified: 2021-10-01 10:51 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.