harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Egor Pasko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2815) [classlib][security][drlvm][performance] very slow security checks with quadratical dependence on number of stack frames
Date Wed, 20 Dec 2006 12:02:23 GMT
[classlib][security][drlvm][performance] very slow security checks with quadratical dependence
on number of stack frames
------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2815
                 URL: http://issues.apache.org/jira/browse/HARMONY-2815
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: any/ia32
            Reporter: Egor Pasko
            Priority: Minor


consider the following test:
-----------------------------------------------------------------------
import java.security.Security;

public class SecurityPerfTest {
    public static void main(String[] args) {
        System.setSecurityManager(new SecurityManager());
        for (int i = 0; i < args.length; i++ ) {
            long start_time = System.currentTimeMillis();
            int amount = Integer.parseInt(args[i]);
            run(amount);
            long total_time = System.currentTimeMillis() - start_time;
            System.out.println(amount + " " + total_time);
        }
   }

   public static void run(int count) {
       if ( count < 0 ) {
           return;
       }

       //System.out.println("Runner: " +  count);
       System.getProperty("os.name");
       run(count - 1);
   }
}
-----------------------------------------------------------------------

where each recursive call of run() checks for security permissions

to run it, issue the recursion depth list via command-line parameters like this:
java SecurityPerfTest 50 100 150 300 350 400 450 500 

on Jrockit/ia32 the time spent for each step depends linearly on the number of
iterations:
50 107 // this line should be ignored
100 1
150 1
300 3
350 5
400 6
450 7
500 9

on Harmony (DRLVM) the dependency looks like quadratic:
50 114
100 647
150 1931
300 13798
350 21171
400 31116
450 43786
500 59547

I suspect too many stack unwindings performed on this microbenchmark


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message