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/17 05:56:50 UTC

[jira] Commented: (HARMONY-6117) [classlib] do not use File.getCanonicalPath in FilePermission

    [ 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.