News for hackers. Stuff that matters.
Re:In what cases is Java faster than C++? by stcredzero on Wednesday February 16, 2011 @10:31AM (#2226710)
Exactly. What a lot of dynamic VM languages provide are very clean semantics and the ability to prototype very quickly. Competently tuned GC with a modern VM will get you beyond the ability of a bad or mediocre C coder, calendar-time faster, though at the price of more machine resource use.

I'm waiting for technology that makes this trade-off obsolete. One should be able to transition from fast prototyping to solid and optimal production code -- incrementally and without great pain. We as an industry are just about ready for this.

Re:In what cases is Java faster than C++? by JoeAltmaier on Wednesday February 16, 2011 @11:03AM (#2226899)
I'm lost - what does "competently tuned GC" mean? There is some way to get the GC to NOT ever run? not take forever? What?

And even if you contrive your app to use memory very very carefully, with a shared runtime with 100 other apps (e.g. on a server) not everybody is as nice and GC still runs/stalls the system.

Re:In what cases is Java faster than C++? by stcredzero on Wednesday February 16, 2011 @11:19AM (#2226965)
I'm lost - what does "competently tuned GC" mean?

You can easily get generational GC to be an order of magnitude slower than it should be by changing just one or two settings.

There is some way to get the GC to NOT ever run?

Yes, this actually came up at Smalltalk Solutions many years ago. One presenter was using Squeak as an advanced debugger at a company producing a FPS game. If all your functionality happens between frames, you can rig it so you never GC. You just throw away all of your memory outside of "perm" space every time.

With VisualWorks Smalltalk, you can change the settings so that the bulk of your GC work happens using incremental GC. It's not uncommon to get to the point where GC never takes up more than a few milliseconds. That's plenty good for most people. Admittedly that's not so good if your "light" request load is well over 1000 transactions per server per second.

And even if you contrive your app to use memory very very carefully, with a shared runtime with 100 other apps (e.g. on a server) not everybody is as nice and GC still runs/stalls the system.

When you need enough virtual hosts to be running 100 server processes -- that's likely when you need to be transitioning out of "rapid prototyping" mode and onto processes with just a little more rigor.

What I'm advocating is a language where both the rapid prototyping and running optimized mature code efficiently is possible. Not only possible, but easy to transition between.