harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6117) [classlib] do not use File.getCanonicalPath in FilePermission
Date Tue, 17 Mar 2009 04:56:50 GMT

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


Mime
View raw message