News for hackers. Stuff that matters.
Re:Why Java Will Always Be Slower than C++ by tx on Sunday July 20, 2008 @01:50PM (#251523)
Last year we've built a storage unit for IP surveillance cameras where we've written our own filesystem optimized for continuous writing with zero fragmentation. We had only 4MB of RAM available and the requirement was to never use more than 10% of CPU, which was as powerful as 386DX (remember those?). These things operate 24/7, mounted on telephone poles, for years, without human supervision.

Yes, in C++.

As a side thought: if Apple were dumb enough to embrace Java instead of sticking to Objective-C, I doubt that OSX-powered iPhone (with a full-sized WebKit) would have been possible. Just look at Microsoft and their Vista disaster, this what happens when you start believing into "megahertz and gigabytes are cheap".

Re:Why Java Will Always Be Slower than C++ by gaius on Sunday July 20, 2008 @02:11PM (#251535)
Yes, in C++

My point being, he cited a lot of example that would have been no slower in Java.

this what happens when you start believing into "megahertz and gigabytes are cheap".

As I say to the people I work with all the time, yes computational power is cheap, but it's cheap for everyone, our competitors included. The ability to throw raw power at a problem is not a competitive advantage.

As an aside, I wish CS was taught like that. "You are never going to need to write your own sort ever, but we are going to teach you about sorting so you understand that smart algorithms always beat brute force. Pay attention."

My personal opinion of Java is that its shortcomings were either necessary for or worth putting up with for a world of applications on demand running on heterogenous client devices (i.e. the original applet vision). Now that it's mainly used in known environments (i.e. your own servers) it has to compete on its merits alone, and that's where it struggles. But I really don't mind if other people want to shackle themselves to it :-)

Re:Why Java Will Always Be Slower than C++ by borud on Sunday July 20, 2008 @05:12PM (#251671)
By today's standards, your surveillance solution would qualify as an embedded solution and a fairly resource constrained one at that. It would make sense to use C or C++ in that situation: you can afford to spent a lot of effort on a fairly minimal set of features.

The same may not apply for other projects. I for one spend most of my time worrying about IO, availability and how to best take advantage of multiple CPUs and cores. In this, C++ isn't exactly giving developers anything for free (concurrency still not even being part of the language).

As for Java on mobile: there are projects that are going that route. I'd wait and see before I postulated whether this is a good idea or not.

I don't really understand how Vista fits into this discussion at all. In my opinion, Vista is the result of developers being paralyzed by the sheer weight of their legacy code and interoperability with legacy code. Completely different issue.

Re:Why Java Will Always Be Slower than C++ by tx on Sunday July 20, 2008 @06:05PM (#251705)
As for Java on mobile: there are projects that are going that route. I'd wait and see before I postulated whether this is a good idea or not.

I'm sure you've seen "Java: Please Wait..." on tiny mobile screens with famous Java logo (cup of coffee). I am yet to run into "Please Wait: Objective-C..." screen on the iPhone.

Re:Why Java Will Always Be Slower than C++ by borud on Monday July 21, 2008 @11:18AM (#252304)
I wasn't talking about J2ME. In my opinion J2ME is utterly pointless.
Re:Why Java Will Always Be Slower than C++ by anamax on Sunday July 20, 2008 @10:10PM (#251856)
Could that be because the objective-C run-time or the relevant apps doesn't have that functionality?