TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why Java Will Always Be Slower than C++

11 pointsby theoneillalmost 17 years ago

7 comments

herorevalmost 17 years ago
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.
volidaalmost 17 years ago
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
borudalmost 17 years ago
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 未加载
jlouisalmost 17 years ago
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.
rbanffyalmost 17 years ago
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 未加载
gaiusalmost 17 years ago
<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 未加载
ltbarclyalmost 17 years ago
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 未加载