test/runtime/6925573/SortMethodsTest.java
Print this page
rev 6248 : [mq]: 6959423
*** 45,55 ****
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
--- 45,54 ----
*** 80,90 ****
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) {
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));
--- 79,89 ----
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 < 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,129 ****
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) {
throw new RuntimeException("ATTENTION: it seems that class loading needs quadratic time with regard to the number of class methods!!!");
}
}
}
--- 118,128 ----
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 > 60) {
throw new RuntimeException("ATTENTION: it seems that class loading needs quadratic time with regard to the number of class methods!!!");
}
}
}