back to article Reality check: Java 8 finally catches a multi-core break

Two years later than planned, Oracle has made Java ready for a multi-core processor world. The database giant has announced general availability of Java 8, calling it a “major new release”. Java 8 is important because it’s the base spec for Java Enterprise Edition, as well as feeding the free and open-source implementation of …

COMMENTS

This topic is closed for new posts.

Page:

Anonymous Coward

We're writing in Java 6 with a lot of stuff still in Java 5. It's going to be a while before we get to use any of those new features.

4
1
Silver badge

Your developers need a bit of training. Stop watching TV in the evening and read a Manning book.

1
16
Silver badge

@Destroy All Monsters: In the real world, Mr Monsters, adoption of a new version of a development platform is constrained by the necessity to regression-test what is often a large body of code, and to maintain compatibility with existing libraries and infrastructure. Developer ignorance is rarely a factor. If it was left to developers, most coding would be done on the bleeding edge.

13
1
Silver badge

I know I know. But how hard can it be to regression test code running on a nominally backward-compatible JVM?

Unless of course, the test code has been left "for later" (*cough*)

And the documentation ..ummm... "cannot be found"

4
4
Anonymous Coward

We're writing in Java 6 with a lot of stuff still in Java 5.

Do you mean you're still deploying on Java 5 and 6 runtimes (both of which are no longer supported)? If so, why? Haven't had any issues moving three massive systems to Java 7 - no code changes necessary, and the new features such as "try with resources" are great.

4
0

Carrying out a regression test like this is fine if your application is fairly small.

Do this to a massive amount of developers, who could be spread about the globe, then you will need to spend a not insignificant amount of time not only preparing the regression tests but also making changes (if needed) to the unit/FIT test(s) as well.

0
0
Bronze badge

seems Oracle's developers need it too..

Installing Oracle 11.2.0.4 on Linux right now and the installer is using Java 1.5.0_51

For something as trivial as a software installer I would of think it would be more up to date..but I am not an Oracle expert I'm sure it's par for the course.

Looks like Java 5 saw it's last public update at least in October 2009.

3
0

I work for a bank.. We're still using Java 5 and 6 mostly with some brand new bleeding edge code being deployed with Java 7... but that's not standard and not properly approved... Our server builds are all Java 6 by default. But hey, we also still have lots of Windows XP around too. I don't think we'll see any Java 8 until 2020 at least.

3
0
Anonymous Coward

Oracle's product range has always been a security nightmare. When a product requires a JRE just to install, you know it's a pile of crap underneath....

2
6
Silver badge
Paris Hilton

but that's not standard and not properly approved...

How exactly does you bank approve a new JVM? Do they rub body pieces of the CIO over it?

6
0
Bronze badge
Happy

Use the less lame repository describe here:

http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

Works fine in Mint 16, I already have Java 8 and NetBeans 8 (off netbeans site) installed; the proper ones, not the _very_ dated lame junk one the Mint repositories.

If that doesn't work, try this:

http://community.linuxmint.com/tutorial/view/1372

1
0
Silver badge

> When a product requires a JRE just to install, you know it's a pile of crap underneath....

You mean like having to install a .NET framework.

http://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx

5
1
Anonymous Coward

It's not our decision what we program in ninety nine times out of a hundred. There's all sorts of policies and guidelines that have to be followed. As much as we'd like to be programming in more recent versions, it takes time to change our development environments. Especially when the managers have to decide do we spend the money on updating our Java 5 programs to Java 6, setting things up for Java 7 or do we focus on getting all our VB apps rewritten in something that will run on Windows 7 before XP is put down.

1
1
Anonymous Coward

When even the managers say the department is at 75% strength of what it should be, the XP kill switch is going to be thrown soon and you've got big important projects coming down the line with fixed dealines, you've got ot pick your battles and be realistic about what can wait.

1
1
Anonymous Coward

@1Rafayal

I don't think anyone would deny that setting up and executing a regression testing system is expensive in time and money. However, it would be hard to think of a better example of Philip Crosby's famous dictum that quality is free - but only to those who invest heavily in it. In other words, quality costs money but saves so much that in the long (or even medium) term you end up better off. Not to mention your customers, and everyone else who benefits from software that works properly and is reliable and secure.

4
1
Anonymous Coward

@Troy Peterson

"I don't think we'll see any Java 8 until 2020 at least".

By which time it will be obsolescent and, no doubt, insecure. I can well appreciate that it's hard to keep abreast of software versions when you have a huge infrastructure to maintain, but surely a higher priority could be given to keeping up to date? After all, what is the point of software developers working hard to fix problems if their customers aren't going to enjoy the benefits?

1
0
Anonymous Coward

Installing Oracle 11.2.0.4 on Linux right now and the installer is using Java 1.5.0_51

Oracle are pretty awful about updating their own stuff, although if it's only the installer itself using an old version of Java then that's not so bad. If it's *installing* a 1.5 JRE then that's not good - even when Oracle 11 was first released Java 1.6 had been out for ages.

0
0
Anonymous Coward

Thanks a lot, Bill

"...do we focus on getting all our VB apps rewritten in something that will run on Windows 7 before XP is put down".

It's been a while since I saw a stronger argument for keeping Microsoft out of enterprise software. What kind of supplier makes huge efforts for many years to get developers hooked on a language like VB, only to stop maintaining it and leave them high and dry? Note that the developers have no option, as Microsoft is forcing them to migrate from Windows XP.

I think you'll find real enterprise suppliers like IBM never put customers in such a position. Apart from anything else, it's a loud and clear invitation to quit the Windows platform altogether, and move to something that permits smoother change and greater continuity.

3
0
Silver badge

Re: In the real world

Let me tell you something about the real world.

In the real world programmers who can't move to languages versions that are supported by the companies that released them are the single biggest security threat to the network, the integrity of the business, and possibly the future of the company. With 51 versions of Java 7 behind us, you lot are a bigger problem than IE6 and the coming implosion of Windows XP are.

I work at the user support coal face. Programmers like you who excuse the leads, managers, and CxOs who won't properly support the porting and testing of applications are my single biggest PITA. If I had my druthers, the CIO who hasn't at least moved you off version 5 would be taken to the front of the building and hung until dead while the staff watched. If that didn't motivate people the following month it would be the CEO and whoever reported to the former CIO. And I keep working through the chain until somebody got the message.

2
2
Silver badge

Re: @Troy Peterson

It wasn't so bad when our networks weren't all connected to the internet. You could have the known insecure software installed as long as you had decent AV scanning your floppies for the bad stuff and still be reasonably secure. That's not true anymore. Java is even worse. Sure it's secure so long as you aren't running it in a browser. But really, when was the last time that cutting edge app wasn't running in a browser? Or even the kludgey old one that takes forever for the CCB to approve and then QA to test after the coders are done with their bit?

It's tough being in IT at any level without the resources and management backing to do things right. I get that. Problem is, the world has changed around us. We can't get by with slipshod practices anymore. All the best hackers are banging right on the enterprise door and some of them have government sized resources behind them.

1
0
Bronze badge

Hurrah!!

SE8u1 arrives next week?

1
1

Wait, what?

Lambda Expressions are something that enables multi-core programming, eh? I guess they make the syntax of multi-core programming a bit cleaner, but don't they have another one or two uses somewhere down the line?

19
0
Silver badge

Re: Wait, what?

Well, yeah. Anonymous delegates.

Provide Oracle don't allow chaining they could actually be a step up on C# for a change. This comment will be downvoted by everyone who hasn't spent ten minutes with a headache trying to figure out exactly what a 2-line chain of lambdas actually does.

7
0

Re: Wait, what?

Multicore programming has been in Java since java.lang.Thread. And if you think that lambda syntax is cleaner and more maintainable than the explicit API of java.util.concurrent, well, all I can say is you're going to be creating jobs for contractors for years to come.

5
4

Re: Wait, what?

Lambdas are also damned useful in fluent APIs, where you can't stop to set properties without breaking the chain. Fair enough they are ripe for abuse (what isn't?) but used well they can create beauty too.

I'm just wondering if they'll be done in as half-arsed a manner as generics were.

4
0

Re: Wait, what?

Ugh! Java "generics"! What a waste of time.

When are they going to reimplement them to be true generics (rather than pre-compiler syntax sugar), with the ability to reflect on the underlying type?

1
0
Silver badge

Re: Wait, what?

It's a Gavin Clarke article. Anything technical can be read as "they wave the magic wand and unicorns appear".

Yes, lambda expressions have many uses besides parallel code, and indeed have occasionally been used on single-core systems - for example in every nontrivial program written in LISP or any other functional language1 that's run on a single-core platform.

And Herb Sutter's 2005 piece isn't about "rewriting multi-threaded applications for multicore". It's about rewriting single-threaded applications to be multi-threaded. He talks a bit about explicit parallelization, but it's mostly about threading.

Oracle seems to be pitching Java 8's lambda expressions as a syntactically-simpler alternative to anonymous inner classes, because they're trying to hop on the C# LINQ bandwagon. They know a lot of developers are afraid of functional programming but OK with result-set filtering and attracted by promises of parallel execution (even when crap algorithms or implementation means overall performance is terrible).

1Except Unlambda, of course.

3
0
Silver badge

Re: Wait, what?

> It's a Gavin Clarke article. Anything technical can be read as "they wave the magic wand and unicorns appear".

It's not just me who finds it weird that the Reg's software guy - see contacts list - apparently understands less about software than your average government minister, then? That's a relief.

3
0
Anonymous Coward

Good performance? Scalable?

In what magical wonderland has Twitter’s vice president of infrastructure operations engineering come to THAT conclusion?!

Java's performance is abyssmal, as is it's scalability. If performance truly was their goal, C++ or any other fully compiled language would've outperformed Java by miles, while remaining just as, if not more scalable.

5
29

Re: Good performance? Scalable?

Java performs a lot better than Ruby. And it's not far behind C++.

And one major attraction of Java is its scalability (or the ease that common Java enterprise frameworks enable scalable application design). That's why it is used extensively in the real world.

16
1
JDX
Gold badge

Re: Good performance? Scalable?

So says someone who either hasn't used Java since 2000, or hasn't updated their learning since then. Java's performance is not matter for subjective opinion, it can be measured directly.

Java is not as fast as C++ for bare algorithm implementation comparison. But it is NOT "miles slower" and the difference in speed between Java and Ruby is far greater than the difference between C++ and Java.

I speak not just as a programmer, but one with experience in the world of competitive coding contests where you are given a limited time for your code to process input data and return a result, where language performance is a big deal. Rather than quoting middle-management "I read Java was slow because it's interpreted" levels of misinformation.

20
1

Re: Good performance? Scalable?

Never written a line of Java code, have you?

5
2
Silver badge

Re: Good performance? Scalable?

You choose a programming language based on multiple criteria, including, performance of resulting code, ease of writing code, IDE support, libraries etc.

A language being the latest fad is not the reason to choose it.

You can read a bit more on Twitter's decision to switch to Java at the back end blog.twitter.com/2011/twitter-search-now-3x-faster

7
1
Anonymous Coward

Re: Good performance? Scalable?

I have worked with Java and I have worked with C++/Boost and from my experience Boost simply outperforms Java. Sometimes more, sometimes less. In addition to that, I think that C++ is more intuitive to write and easier to debug.

2
8
Silver badge

Re: Good performance? Scalable?

C++ or any other fully compiled language would've outperformed Java by miles

"Stop me, I'm a moron and I'm gonna use this computer"

9
2
Anonymous Coward

Re: Good performance? Scalable?

No shit?? Why bother trying to compare the speed of C++ to Java?

Of course Java is going to be slower, C++ is compiled to machine code for the CPU it's running under.. not byte-code ran in a VM that's different to the host CPU!

Compare it to other languages of it's class, like C#, if you want to willy wave over speed - not something that has an obvious advantage.

Whenever there's a mention of some language, there's always those types that whine that whatever language they know is the best.

A free programming lesson for you: Nearly all languages are different. They all have different trade-offs. Pick the one that meets your criteria. If you only know one, then stop comparing known with unknown.

PS; I still think Java is crappy :P

7
7

Re: Good performance? Scalable?

"Of course Java is going to be slower, C++ is compiled to machine code for the CPU it's running under.. not byte-code ran in a VM that's different to the host CPU!"

Come back when you understand how modern JVMs work. Wikipedia hint: JIT

13
0
Silver badge
Facepalm

Re: Good performance? Scalable?

Get real!

Peter Van Der Linden was saying Java's performance was miles better back in 1999! FFS! It fair screams along these days and is easily the match of almost any compiled language. Granted it was shit when we were using for applets ( remember coding those anyone? ) back on basic Pentium boxes around '96.

Can't see that Google would base their entire mobile O/S on a poorly performing language where there are limited resources and almost every CPU cycle counts!

13
0
Anonymous Coward

Re: Good performance? Scalable?

I think that C++ is more intuitive to write and easier to debug

You're either trolling or need some heavy medication. The number of books on the gotchas of C++ (the "Effective ..." and "Exceptional ..." ones for example) are an indicator of how unintuitive C++ is. As for debugging, ever tried to debug C++ template code?

12
0
Anonymous Coward

Re: I think that C++ is more intuitive to write

because you're a C++ programmer.

That's not intuitive, that's familiar.

Intuitive isn't what they were going for with C++. I think they were aiming for "ooh, doesn't it look computery and clever" with a side order of "This'll put off the plebs...."

19
0
Silver badge

Re: Good performance? Scalable?

The experts here who know how slow Java is are missing a huge opportunity. I bet all the financial institutions that run high-frequency trading applications written in Java would love to hear how they can boost performance by rewriting in a faster language.

And for those arguing about the syntactical merits of this language or another - that's not really the issue. An intelligent developer can get up to speed with any modern language. The great advantage Java has is its massive body of open-source libraries, and the vast ecosystem of Java programming knowledge that is available.

5
1
Anonymous Coward

Re: Good performance? Scalable?

Come back when you understand how modern JVMs work. Wikipedia hint: JIT

ok, I'm back. Did not realise they JITted. I need to get my head out of my fucked-by-Microsoft arse.

So, Java is compiled on the client machine, able to optimise specifically to the host CPU.. unlike C/C++ that has to work on the lowest common denominator. I take back what I said about it ;)

But I might give Java another try, now.

7
1
Bronze badge

Re: Good performance? Scalable?

> So, Java is compiled on the client machine, able to optimise specifically to the host CPU..

Near enough but it has to do it quickly and may skip a fair few optimizations that a multipass compiler can do.

> unlike C/C++ that has to work on the lowest common denominator. I take back what I said about it ;)

Not on my machines at the very least. You're thinking of closed source things that have to be backward compatible or *nix distros that want to do the same.

My CFLAGS environment variable on my machines include "-march=native". On the laptop I am typing this means optimize for Haswell G4. I'll bet your system isn't compiled to that degree of ridiculously modern!

So, it is not a failing of C/C++ but merely how the output is intended to be used. MS could release a version of Windows which will only run on the very latest CPU.

Now it's also not that simple either.

You can include multiple code paths that depend on the CPU flags available. Your binary will get commensurately bigger though but it will run on your lowest supported CPU but take advantage of newer stuff.

Put 50 milllion odd records in an Elastic Search database and then see whether Java is slow 8) Try it - its free. Or try out MongoDB (can't remember if that one is Java - think so). While you are at it run up Log Stash and Graylog2. A mass of Java and bloody fast. I ran that lot on my desktop PC for a demo for a few weeks (quad core old Intel processor, 8GB RAM, one SATA disc (with some SMART failings)) with Postgres, MariaDB, Apache, and a Jasper Reporting set up in the background whilst I crack on with work on KDE in rather nice 3D accelerated desktop across multiple monitors.

Whoever above mentioned the installer needing an old JVM may like to notice that it can be installed in a CLI from a .tar.gz or .zip or whatever.

Cheers

Jon

6
0

Re: Good performance? Scalable?

Any decent (not over engineered!) java program will run at about 1 and a half times the speed of the equivalent C++ program.

The difference is the Java will be debugged and in production while the C++ programmer is still trying to sort out his memory leak in between arguing with his colleagues over what Soustrup really meant to say in chapter 13.

7
0

Re: Good performance? Scalable?

There is more to it than that. Current JVM-s are not just JIT compilers, they are JIT optimizers. They instrument your code at run time to determine what is worth aggressively optimizing, that is what parts of the code are used the most ... this is why it's called "Hotspot". But it goes further than that. A compile time optimizer can only perform a change when it is 100% sure that the semantics are the same in all possible cases. A run time optimizer can make "illegal" changes based on actual usage and undo the change if needed. The most important use of this is with inlining. According to the language semantics (this applies both to Java and C++) a method call cannot normally be inlined, because at run time a class may be loaded which overrides the method (and this should now be called instead of the inlined code). Hotspot happily does the inlining and if the described case arises, it undoes it. In my experience with compilers and optimization, inlining (and for some languages, tail-recursion optimization) are by far the most effective optimizations followed by moving invariants out of loops.

Another point is that it is irrelevant that not all of the code is optimized or even compiled. The execution time of the hotspots completely dominates the total execution time. What is compiled/optimized by Hotspot depends on JVM parameters. In fact there is a client version and a server version. They differ mostly in how much time Hotspot spend observing the code before deciding to optimize. Shorter for the client version for fast startup, but a bit less efficient code and longer for the server version with a reversed trade off.

7
0
JDX
Gold badge

Re: Good performance? Scalable?

>>Come back when you understand how modern JVMs work. Wikipedia hint: JIT

To be fair, it's still not as fast as C++. The JIT evangelists claim JIT should mean Java/C# runs as fast as C++ or even faster (since it can compile for the exact CPU you're using) but I have never seen this in real life. What I have seen is that the difference in speed is not a big deal. Maybe a factor of 2 rather than a factor of 10, for doing heavy computation in a tight loop.

3
3
Anonymous Coward

Re: Good performance? Scalable?

Near enough but it has to do it quickly and may skip a fair few optimizations that a multipass compiler can do.

Yes, fair enough. 5 minutes on a 'release' build is ok, but not at application start-up.

You're thinking of closed source things

Yes. For now, I'm a Windows developer.

0
0
Anonymous Coward

Re: Good performance? Scalable?

To be fair, it's still not as fast as C++. The JIT evangelists claim JIT should mean Java/C# runs as fast as C++ or even faster

It doesn't matter if C++ is faster than Java. For what it lacks in speed, it gains in development and maintenance cost, and platform compatibility (post-compile).

Most of the time, the speed isn't a problem. For few times when it does.. C++ can be used for those specific costly algorithms.

The very fact that people are now comparing Java to C++ in terms of speed is itself a compliment to Java.

I think Java has gained a lot of bad press and stigma regarding performance, especially in the early years when compiled languages ruled. Unfortunately, people (like myself) still think today's Java is like 90's Java (and Microsoft's implementation).

4
0
Anonymous Coward

Re: Good performance? Scalable?

I think Java has gained a lot of bad press and stigma regarding performance, especially in the early years

Some of that stigma was deserved in the early days, since assumptions had been made in the design and implementation of Java that turned out to be incorrect and there wasn't yet the experience to know how to code in Java most effectively. Much of this has been sorted out, a simple example being the revised Collections classes that no longer synchronise every method call in the most commonly used classes. The JVM has also evolved to be a technical wonder, and the garbage collection has been reworked to provide optimal performance in most real world scenarios.

0
0
Anonymous Coward

Re: Good performance? Scalable?

"Java's performance is abyssmal, as is it's scalability".

You see, that's a drawback of posting as AC. No one has any idea where you come from, or what your motives are. Your statement is factually untrue, yet it is couched in very decided and forceful language. Why are you so keen to talk Java down? Are you an M$ shill, or just someone who tried Java without sufficient study and preparation?

Without any of that information, we are (alas) likely to draw the worst conclusions.

By the way, there is only one "s" in "abysmal". And Lynne Truss will be calling on you to explain the proper use of apostrophes. I often wonder about the implications for a person's ability to design and write complex code, when they can't even manage the relatively simple task of writing plain English.

3
2

Page:

This topic is closed for new posts.

Forums