TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why Java Will Always Be Slower than C++

11 点作者 theoneill将近 17 年前

7 条评论

herorev将近 17 年前
This essay has been around since at least August 2001. <a href="http://web.archive.org/web/20010802062551/http://www.jelovic.com/articles/why_java_is_slow.htm" rel="nofollow">http://web.archive.org/web/20010802062551/http://www.jelovic...</a><p>It is fairly well-known. I wasn't too surprised when I saw it show up on Reddit recently, but I was disappointed to see it show up here. It's getting harder each day to see any kind of difference between Reddit and Hacker News.
volida将近 17 年前
Java allows you to write better multi-threaded code etc where as C++ lets you fight with all those details therefore losing productivity for some perfomance, which thanks to multi-cores the slowness comparing to C++ will be insignificant
borud将近 17 年前
More often than not it is not the language that decides the performance of a system, but the ability of the programmer to come up with sensible designs.<p>This becomes even more important as parallel and computing becomes more important. Designing and implementing systems that run on a single CPU isn't all that hard given all the tools, libraries and abundance of literature developers have access to at little or no cost. Writing software that spans CPUs and even computers is a different matter.<p>Writing an application like Twitter isn't hard. Making it scale shouldn't be, but apparently still is. Doing twitter in C++ might offset the problems they experience somewhat, but not meaningfully so.
评论 #253419 未加载
jlouis将近 17 年前
It is much more interesting to know the performance model of a given language than comparing languages. If you know the performance model, you know what costs, so you begin writing programs that avoid doing expensive things.<p>And it will always be the case that the clever algorithm or data structure is much better at getting some cycles back than switching language.<p>Part of the article is also wrong. A dynamic lookup can often be avoided if you have a dataflow analysis phase in the compiler for instance. It is almost "the" optimization for OO languages like Java.
rbanffy将近 17 年前
Besides being very old, as heroev well pointed out, this is a quite obvious article.<p>Just like C++ is slower than assembly, which is slower than using microcode, which is slower than coding at the logic-gate level.<p>It's not that writing Java code is easier than writing C++. The fact is that writing memory leaks is a lot harder in Java than it is in C++.
评论 #251664 未加载
gaius将近 17 年前
<i>Speed still maters. I still wait for my laptop to boot up. I wait for my compiler. I wait on Word when I have a long document.</i><p>Ummm, yeah, C++ can magically access the disk faster than Java. NOT!!
评论 #251523 未加载
ltbarcly将近 17 年前
This essay is bullshit, the author doesn't understand anything he is talking about to the point of absurdity (allocating objects on the stack takes 0 time???) and he largely repeats the common-knowledge on slashdot, as geniuses like this are so often caught doing.
评论 #251623 未加载