当我运行PS时,其中一列输出是TTY.这是什么意思?特别是,作为"??"的价值如何 与"ttys000"比较?
我问,因为我有一个Java程序运行sort通过的ProcessBuilder,而当这个程序是通过我的IDE(的IntelliJ)运行过程需要时为IDE外部可执行的JAR运行低于5倍.
在每种情况下,我都在运行排序时运行ps,唯一的区别是IDE创建了一个TTY为??的进程.而jar创建一个TTY为ttys000的进程.
我们有一个应用程序通过拆分数据并对其进行排序来导入大量文件.运行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) 当我通过Eclipse执行下面的简单代码示例(版本3.5.2,在Ubuntu 10.04上,java版本"1.6.0_20"OpenJDK运行时环境(IcedTea6 1.9.9)(6b20-1.9.9-0ubuntu1~10.04.2)OpenJDK服务器VM(内置19.0-b09,混合模式)),大约需要10秒钟.当我从我的shell执行它(使用相同的优先级和java版本)时,大约需要40秒.
for (int i = 0; i<1000*1000; i++) {
System.out.println(Math.cos(i));
}
Run Code Online (Sandbox Code Playgroud)
我还尝试了其他程序,在运行时和输出量方面各不相同:每个程序在shell中都要慢得多.这与执行顺序无关.对于输出很少的程序,Eclipse中的最小百分比差异为85秒,而shell为145秒.
什么原因?
我的 boost 服务器意外停止接受传入连接,因为我团队中的其他人在不同线程(使用不同端口)中使用 boost 接受器创建了另一个服务器?这是正常的吗?如何让两个服务器独立工作而不互相干扰?
已解决:接受器与此无关,这家伙在某个地方启动了无限循环,阻塞了其他组件。我想这就是当团队工作不协调时会发生的情况:( 对不起,伙计们,sehe 一如既往地是最好的