test/runtime/6925573/SortMethodsTest.java

Print this page
rev 6248 : [mq]: 6959423

@@ -45,11 +45,10 @@
 import javax.tools.SimpleJavaFileObject;
 import javax.tools.StandardJavaFileManager;
 import javax.tools.ToolProvider;
 
 /*
- * @ignore 6959423
  * @test SortMethodsTest
  * @bug 6925573
  * @summary verify that class loading does not need quadratic time with regard to the number of class
 methods.
  * @run main SortMethodsTest

@@ -80,11 +79,11 @@
     JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
     DiagnosticCollector<JavaFileObject> diags = new DiagnosticCollector<JavaFileObject>();
     final String cName = new String("ManyMethodsClass");
     Vector<Long> results = new Vector<Long>();
 
-    for (int i = 6; i < 600000; i*=10) {
+    for (int i = 6; i < 60000; i*=10) {
       String klass =  createClass(cName, i);
       JavaMemoryFileObject file = new JavaMemoryFileObject(cName, klass);
       MemoryFileManager mfm = new MemoryFileManager(comp.getStandardFileManager(diags, null, null), file);
       CompilationTask task = comp.getTask(null, mfm, diags, null, null, Arrays.asList(file));
 

@@ -119,11 +118,11 @@
       long ratio = normalized2/normalized1;
       lastRatio = ratio;
       System.out.println("10 x more methods requires " + ratio + " x more time");
     }
     // The following is just vague estimation but seems to work on current x86_64 and sparcv9 machines
-    if (lastRatio > 80) {
+    if (lastRatio > 60) {
       throw new RuntimeException("ATTENTION: it seems that class loading needs quadratic time with regard to the number of class methods!!!");
     }
   }
 }