- 论坛徽章:
- 0
|
原文连接
Java performance improvements touted
Technologists acknowledge previous shortcomings but point out that Java's performance now equals or tops apps developed in C
By Paul Krill
March 26, 2008
Java is not the slowpoke of old days and performance now matches or exceeds applications developed in C, technologists stressed Wednesday during a presentation at TheServerSide Java Symposium in Las Vegas.
Java 已经再也不是过去那个慢腾腾的玩意了,在某些应用上,现在它的性能已经能够达到甚至超过C的性能。在周三拉斯危加斯的服务端应用的java 论坛上,有技术人员这样强调。
Java Virtual Machines and garbage collection, for example, have improved and Java itself has come along way, the technologists argued. Early Java Virtual Machines were indeed slow, said Brian Goetz, Sun senior staff engineer. But that has changed.
以Java虚拟机和垃圾回收机制为例,技术人员称,这些技术已经得到了广泛的改进,而且java本身也经历了长足的发展。Sun的高级工程师Brian Goetz声称, 早期的java 虚拟机的确是很慢,但是这种情况已经发生变化。
"The reality is, Java is pretty fast these days," Goetz said. Java performance now measures up to C but lags behind in memory consumption, he said.
"事实是,现在的java的确已经很快了",Goetz补充道,"Java的性能目前已经能够赶上C,只是在内存占用上面还有很多处于下风"
He and Cliff Click, chief JVM architect at Azul Systems, looked to debunk several myths, such as object allocation being slow. "This was one of those things that was absolutely true a long time ago," said Goetz. Garbage collection also was slow because it had to stop programs, trace the heap, and look for objects to discard. "It's not surprising in the early days people came to the conclusion that memory management in Java was really intensive," he said.
他和Azul Systems的JVM首席架构师,Cliff Click旨在澄清一些误解,比如对象分配之类技术效率欠佳等。"这些技术在以前有些的确是很慢的",Goetz称,垃圾回收很慢是因为它要中断程序的运行,还要跟踪内存堆,找出需要释放的对象。"在早期的时候人们得出这样的结论并不奇怪,java的内存管理是很频繁的"
Another myth is that synchronization is slow. But changes have been made such as better locking algorithms, said Goetz. He also noted the continued perpetuation of the myth that Java programs spend 20 percent of their time in garbage collection, a belief traced to a paper written in 1995.
An attendee concurred about Java's performance. "We run a huge J2EE application, and we meet all our service-level agreements all the time," said Jerald Nielson, of Accenture. The program is an automated welfare system for the state of California, he said.
另一个误解是,同步的也会产生效率问题。但是随着一些更好的加锁算法的出现,情况也已经有所改观。Goetz表示,他同时注意到有个长期以来一直难以有所改变的看法,就是java通常会有20%的时间花在垃圾回收上,这样的观点可以追溯到1995年的一篇论文。在同一论坛上有与会着表达同样的观点,"我们运营着一个庞大的J2EE应用,并且总是能够达到我们的服务性能指标",Jerald Nielson表示,那是一个加州的福利自动化系统。
Java has gotten better because of incremental improvements, Click said after the session. "The garbage collection's definitely gotten better, the JIT's (Just in Time compiler) gotten better, the runtime's gotten better, a lot of things have gotten better," Click said.
Java在逐步的改进中已经变得越来越好了,会后Click称。"垃圾回收无疑已经得到了改进,JIT(及时编译),得到改善,运行时环境得到改进,很多东西都已经今非昔比了"
Java also enjoys a 10-times performance advantage over interpreted scripting languages like JavaScript, Perl and Python, he said. "The scripting languages aren't JIT-ted yet," he said.
相对与javascript,perl,python 之类的脚本语言,Java 能够带来10倍以上的性能提升。他表示“这些语言还没有类似JIT的机制”
Scripting languages are ideal for smaller programs but Java is the choice for larger programs, he said. "As your program grows in size, the lack of strong typing basically kills your ability to handle a very large program and so you don't find the million-line Perl program," he said. One-million-line Java programs are plentiful, Click said. Strong typing refers to the capability of knowing the type of memory objects.
脚本语言是为小型的程序准备的,而java则是开发大型应用的选择。他说:“当你的程序规模在扩大时,对于强类型机制的缺乏将使你逐渐失去控制程序的能力。这也是为什么你没有见过百万行以上的perl程序的原因”,而百万行级别的java 应用还是很常见的。Click说。强类型意味着能够知道内存对象逻辑类型的能力。
Also during the symposium Wednesday, Neal Ford, senior application architect at ThoughtWorks, spoke of DSLs (domain-specific languages) as a way to simplify programming. A DSL is a next step after a framework like Spring, he said. DSLs allow developers to express ideas in a concise way while objects, aspects, and generics become building blocks for a DSL, he said.
在周三的同一场会议上,ThoughtWorks的高级应用架构师Neal FordDSL(面向领域的语言)提供了一种更为简洁的编程方式,DSL是类似Spring这样的框架的进一步扩展,他透露,DSL能够让开发者简洁地表达逻辑,而对象,方面,和泛型成为DSL的组成部分。
"You build a framework like Spring to handle aspects, but even something like Spring is getting complicated now," he said.
“你通过搭建Spring这样的框架来处理面向方面的问题,但是现在Spring都嫌复杂了”他补充说。
Language workbenches, such as Microsoft's Software Factories or JetBrains's MPS (Meta-Programming System), represent external DSLs, he said.
而语言平台开发商,如微软软件工厂,JetBrains的MPS(元编程系统),都提供了外接的DSL.他说
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/45752/showart_521415.html |
|