You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Regis Xu (JIRA)" <ji...@apache.org> on 2009/03/11 09:42:50 UTC
[jira] Created: (HARMONY-6117) [classlib] do not use
File.getCanonicalPath in FilePermission
[classlib] do not use File.getCanonicalPath in FilePermission
-------------------------------------------------------------
Key: HARMONY-6117
URL: https://issues.apache.org/jira/browse/HARMONY-6117
Project: Harmony
Issue Type: Sub-task
Components: Classlib
Affects Versions: 5.0M8
Reporter: Regis Xu
File.getCanonicalPath is very slow in Harmony, avoid to use it will significant improve performance when SecurityManager is installed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6117) [classlib] do not use
File.getCanonicalPath in FilePermission
Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682557#action_12682557 ]
Regis Xu commented on HARMONY-6117:
-----------------------------------
I tested the performance of this patch with following simple benchmark:
<code>
public static void main(String[] args) throws IOException {
System.setSecurityManager(new SecurityManager());
File file = new File("FilePerTest.java");
long start = System.currentTimeMillis();
for (int i = 0; i < 40000; ++i) {
file.isFile();
file.exists();
file.canRead();
}
long end = System.currentTimeMillis();
System.out.println("Time is: " + (end - start));
}
</code>
I got results:
before patch: 45954ms
after patch: 14188ms
> [classlib] do not use File.getCanonicalPath in FilePermission
> -------------------------------------------------------------
>
> Key: HARMONY-6117
> URL: https://issues.apache.org/jira/browse/HARMONY-6117
> Project: Harmony
> Issue Type: Sub-task
> Components: Classlib
> Affects Versions: 5.0M8
> Reporter: Regis Xu
> Attachments: FilePermission.v2.diff, FilePermisson.diff
>
>
> File.getCanonicalPath is very slow in Harmony, avoid to use it will significant improve performance when SecurityManager is installed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6117) [classlib] do not use
File.getCanonicalPath in FilePermission
Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Regis Xu updated HARMONY-6117:
------------------------------
Attachment: FilePermission.v3.diff
This patch still use getCanonicalPath on Linux, because I haven't found a better way to resolve symbol links on Linux, which did by getCanonicalPath.
> [classlib] do not use File.getCanonicalPath in FilePermission
> -------------------------------------------------------------
>
> Key: HARMONY-6117
> URL: https://issues.apache.org/jira/browse/HARMONY-6117
> Project: Harmony
> Issue Type: Sub-task
> Components: Classlib
> Affects Versions: 5.0M8
> Reporter: Regis Xu
> Attachments: FilePermission.v2.diff, FilePermission.v3.diff, FilePermisson.diff
>
>
> File.getCanonicalPath is very slow in Harmony, avoid to use it will significant improve performance when SecurityManager is installed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6117) [classlib] do not use
File.getCanonicalPath in FilePermission
Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Regis Xu updated HARMONY-6117:
------------------------------
Attachment: FilePermission.v2.diff
This patch deal with Windows short name and network driver, also added some tests.
I just tested on Windows, will try on Linux.
> [classlib] do not use File.getCanonicalPath in FilePermission
> -------------------------------------------------------------
>
> Key: HARMONY-6117
> URL: https://issues.apache.org/jira/browse/HARMONY-6117
> Project: Harmony
> Issue Type: Sub-task
> Components: Classlib
> Affects Versions: 5.0M8
> Reporter: Regis Xu
> Attachments: FilePermission.v2.diff, FilePermisson.diff
>
>
> File.getCanonicalPath is very slow in Harmony, avoid to use it will significant improve performance when SecurityManager is installed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6117) [classlib] do not use
File.getCanonicalPath in FilePermission
Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Regis Xu updated HARMONY-6117:
------------------------------
Attachment: FilePermisson.diff
this patch is just a prototype, just tested on Windows, the value for Linux is still unknown.
It didn't deal with win32 short name of path and network driver.
comments/suggestions are welcome.
> [classlib] do not use File.getCanonicalPath in FilePermission
> -------------------------------------------------------------
>
> Key: HARMONY-6117
> URL: https://issues.apache.org/jira/browse/HARMONY-6117
> Project: Harmony
> Issue Type: Sub-task
> Components: Classlib
> Affects Versions: 5.0M8
> Reporter: Regis Xu
> Attachments: FilePermisson.diff
>
>
> File.getCanonicalPath is very slow in Harmony, avoid to use it will significant improve performance when SecurityManager is installed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.