United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6870926 (file) Path.toRealPath performance can be improved (win)
6870926 : (file) Path.toRealPath performance can be improved (win)

Details
Type:
Bug
Submit Date:
2009-08-12
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-08-28
Component:
core-libs
OS:
generic
Sub-Component:
java.nio
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports

Sub Tasks

Description
The toRealPath method has a number of performance issues that should be fixed:

1. On Vista/newer it uses GetFinalPathNameByHandle to get the final path with all symbolic links resolved. This Win32 call requires opening the file and is slower than the fallback implementation for common case that the path does not contain any symbolic links.

2. On XP or when GetFinalPathNameByHandle fails, the implementation always checks that the root directory exists. This is expensive and not required for the case that the path has one or more name components (because the directory search to get the actual name requires that the root directory exist).

2. On XP or when GetFinalPathNameByHandle fails, the implementation always calls GetFullPathName to collapse . and .. but this is not required when . is not present.

                                    

Comments
EVALUATION

As per evaluation.
                                     
2009-08-18



Hardware and Software, Engineered to Work Together