我们有一个应用程序通过拆分数据并对其进行排序来导入大量文件.运行JUnit测试用例时,整个过程大约需要16分钟.
同样的测试,mvn clean test -Dtest=MyTest在34分钟内完成.
我们正在调用/bin/sort对文件进行排序.这种情况似乎需要更长的时间.我不明白有什么不同.
看看它运行的IntelliJ
/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/bin/java -Didea.launcher.port=7532 -Didea.launcher.bin.path=/Applications/IntelliJ IDEA 10.app/bin -Dfile.encoding=UTF-8 -classpath %classhpath% com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 xxx.IntTestImportProcess,testImportProcess
Run Code Online (Sandbox Code Playgroud)
我在OS X上.所有类都是使用Spring注入的.有哪些可能的建议是关于IntelliJ中这种性能提升背后的理论?测试是相同的.我无法分享所有代码,因为有这么多.但是我可以根据要求添加任何细节.
这是我的主要课程,以及我如何运行这两个课程.
public static void main(String... args) throws IOException {
if(args.length != 2) {
System.out.println("Usage: \n java -jar client.jar spring.xml data_file");
System.exit(1);
}
ApplicationContext applicationContext = new FileSystemXmlApplicationContext(args[0]);
PeriodFormatter formatter = new PeriodFormatterBuilder()
.appendMinutes()
.appendSuffix("minute", "minutes")
.appendSeparator(" and ")
.appendSeconds()
.appendSuffix("second", "seconds")
.toFormatter();
URI output = (URI) applicationContext.getBean("workingDirectory");
File dir = …Run Code Online (Sandbox Code Playgroud)