Parallelism for Java8

194 views
Skip to first unread message

Edward Harned

unread,
Feb 26, 2013, 9:46:51 AM2/26/13
to java...@googlegroups.com
My last article caused a lively discussion: https://groups.google.com/d/topic/javaposse/Rfp7t23lQTo/discussion

I've added a new article just for Java8: http://coopsoft.com/ar/Calamity2Article.html

constructive criticism is always welcome.

ed

Casper Bang

unread,
Feb 26, 2013, 12:32:43 PM2/26/13
to java...@googlegroups.com
Very interesting article. While I can't claim to understand it all in detail, I am not too surprised (this is Java after all). How can one expect a coherent, simple and pragmatic parallel programming model, by a CS professor isolated at his university?! 

This is in stark contrast to C#, where the elephant is chopped up and digested in pragmatic pieces by a team of designers meeting 3 times a week, responsible for the programming model as a whole (one does not need to be a CS major to use PLINQ, Parallel.For etc.).

Bummer :/

Jess Holle

unread,
Feb 26, 2013, 12:49:04 PM2/26/13
to java...@googlegroups.com, Casper Bang
Of course the good thing is -- once code is formulated in terms of lambda predicates, switching parallelism engines is a smaller matter.

So if fork-join is full of it, use a different one.  Sure, it will take a bit of a code change to avoid the default parallel streams, but nothing near what it took to change from hard-wired, procedural, data-traversal-and-logic-all-in-one code.

That's not to defend fork-join -- just rejoicing that its far easier to switch parallelism algorithms with lambdas.
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javaposse+...@googlegroups.com.
To post to this group, send email to java...@googlegroups.com.
Visit this group at http://groups.google.com/group/javaposse?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Cédric Beust ♔

unread,
Feb 26, 2013, 1:00:54 PM2/26/13
to java...@googlegroups.com

On Tue, Feb 26, 2013 at 9:32 AM, Casper Bang <caspe...@gmail.com> wrote:
Very interesting article. While I can't claim to understand it all in detail, I am not too surprised (this is Java after all). How can one expect a coherent, simple and pragmatic parallel programming model, by a CS professor isolated at his university?! 

That's a bit of a cheap shot to both Brian and Doug.

I have a better idea: how about submitting this article to a place where it can be discussed among experts, such as the lambda-dev mailing-list? Then we can see the real merits of both sides.

-- 
Cédric

Ricky Clarkson

unread,
Feb 26, 2013, 1:15:39 PM2/26/13
to javaposse
This guy is always on this.  If he's right and his competing work is so good, why have I never come across anyone other than him saying so or using it?  That's not proof that he's wrong, but the constant negativity and lack of other references makes me loathe to even consider his arguments.

Cédric Beust ♔

unread,
Feb 26, 2013, 1:21:51 PM2/26/13
to java...@googlegroups.com
That was my thought too after a cursory read. I mean, "Calamity", "There hasn’t been an uglier pile of spaghetti code since the 1960’s"...

Come on, now. That's not exactly a tone conducive to serious discussion.

-- 
Cédric


-- 
Cédric

Edward Harned

unread,
Feb 26, 2013, 1:40:46 PM2/26/13
to java...@googlegroups.com
The article was submitted to all the mailing lists many times. Ignored all.

ed

Edward Harned

unread,
Feb 26, 2013, 1:42:40 PM2/26/13
to java...@googlegroups.com
Have you looked at the code? Try it and see.The article suggests you look before buying.

ed

Edward Harned

unread,
Feb 27, 2013, 9:22:42 AM2/27/13
to java...@googlegroups.com
Jess Holle:

It would be nice if they could just replace the parallel engine with another, more efficient engine in the future. It is not going to happen.

If they had chosen a general-purpose decomposing engine or just a high-performance thread container (something like .Net 4) then it might be possible. They chose a recursive decomposing framework and now they’re stuck with it.

Serial bulk operations require recursion in order to build the streams. No other way is efficient. The lambda team is having stack overflow problems, but these are somewhat easy to fix since everything is done in one thread.

Parallel bulk operations are being done in a similar fashion since that is the engine they have. All the code is for recursively walking down the leaves of a structured tree. It’s actually harder to do it this way rather than using a scatter-gather technique as I pointed out with the CountedCompleter paragraphs. The stack overflow problems are not that easy to fix since the work spreads among threads. The solutions, so far, are horrendously complex – no surprise here – and will probably get worse since emulated scatter-gather is against the grain of recursive decomposition.

If they ever want to replace the fork/join framework with a non-recursive, general-purpose engine then they will have to refactor all the code that uses the recursion technique. It’s not like putting a Chevy engine in a Ford. It will be a monster undertaking.

ed

Simon Ochsenreither

unread,
Feb 27, 2013, 1:16:45 PM2/27/13
to java...@googlegroups.com

If they ever want to replace the fork/join framework with a non-recursive, general-purpose engine then they will have to refactor all the code that uses the recursion technique. It’s not like putting a Chevy engine in a Ford. It will be a monster undertaking.

Looking at Generics, raw types, primitives vs. wrappers, implicit widening conversions, constant inlining, inner classes, bridge methods, etc. I'm pretty sure that it is rather unlikely that they will touch that or anything else in any substantial way as soon as it is out of the door.
Java is a pragmatic language. Fixing broken stuff is for academics.

clay

unread,
Feb 28, 2013, 1:13:28 AM2/28/13
to java...@googlegroups.com
"A Java™ Parallel Calamity"!?!?

This is the most childish, baseless attack I've ever read. 

If you are going to attack this technology for performance, you need some kind of benchmarks to even begin to look like a serious criticism and not just childish insults without any point.

When JDK7 launched:  I did some benchmarks of my own: I implemented a simple quick sort in serial, one with a simple thread pool with locked data queues, one with a lockless data queues (using Atomic check-and-set ops), and a fork-join implementation. The results were slightly hard to interpret. For small volumes of data, serial worked the fastest. Locked data queues were always slow. My custom lockless data queues worked about as fast as JDK7 fork/join in the higher volume cases.

This is garbage. All attack and insults and Java sucks, .NET rules, and nothing to back it up with.

I am critical of Java 8 (and Guava) for omitting map and flatMap from Optional. I am critical of the Java language for other things, but I have actual specific points with some kind of reason and evidence. This is just hateful trolling of the laziest and worst kind.

Cedric, no he shouldn't submit this to lambda-dev. Anyone can write Java is a big flaming pile of dung and send it, but they shouldn't. Thoughtful negativity is ok. Ranting crazy hateful insults are not. If you have some better ideas, or if you think .NET has some better ideas, you should start with some benchmarks or something close so that we can rule out this kind of utter crap. I have benchmarked fork/join as I said and it did reasonably well. Even Typesafe uses JDK fork/join under the hood for some Scala/Akka stuff and I suspect they chose it for a reason.

Edward and Casper, you are trolling in the worst, laziest, and most disgusting way. You should be deeply embarrassed for posting this kind of thing. I don't see an ounce of legitimate complaint and nothing beyond Java sucks, .NET rules.

morten hattesen

unread,
Mar 2, 2013, 3:36:38 AM3/2/13
to java...@googlegroups.com
Dear Clay, I couldn't help laughing, when I read your post.

This is clearly the most clear example of the pot calling the kettle black I have ever seen.

Your post contains nothing, but ad hominem attacks. Nothing to counter the substance of the argument. It is, in fact, completely off topic.

I guess you havn't had a good day, and just felt like letting out a some steam ;)

Ricky Clarkson

unread,
Mar 2, 2013, 6:04:24 AM3/2/13
to java...@googlegroups.com

I wonder if it's actually ad hominem, given that the complaints were directed at the content rather than the person, and given that the complaints weren't used to show that the arguments were incorrect.

Cédric Beust ♔

unread,
Mar 2, 2013, 12:04:04 PM3/2/13
to java...@googlegroups.com
Definitely "ad articulum", if I got the accusative right :-)

-- 
Cédric

Reinier Zwitserloot

unread,
Mar 12, 2013, 7:28:44 AM3/12/13
to java...@googlegroups.com
If you link to wikipedia pages, do you actually read them?

That wasn't an ad hominem attack. Ad hominem is: "His argument is wrong because he has an ugly face".

Morten Hattesen

unread,
Mar 12, 2013, 7:57:49 AM3/12/13
to java...@googlegroups.com
Reiner,

How would you qualify Clay's posting containing these argument fragments?
    • This is the most childish, baseless attack I've ever read.
    • This is garbage
    • All attack and insults and Java sucks
    • This is just hateful trolling of the laziest and worst kind.
    • a big flaming pile of dung
    • hateful insults
    • you are trolling in the worst, laziest, and most disgusting way
    • deeply embarrassed for posting this kind of thing
      Is it constructive critisism?

      Insulting the poster (ad hominem) for insulting Java 8 Lambda implentation.

      A case of the pot calling the kettle black.

      /Morten

      --
      You received this message because you are subscribed to a topic in the Google Groups "Java Posse" group.
      To unsubscribe from this topic, visit https://groups.google.com/d/topic/javaposse/7_oDA6L0Clo/unsubscribe?hl=en.
      To unsubscribe from this group and all its topics, send an email to javaposse+...@googlegroups.com.

      Reinier Zwitserloot

      unread,
      Mar 12, 2013, 8:30:00 AM3/12/13
      to java...@googlegroups.com
      Comments inline.

      On Tuesday, March 12, 2013 12:57:49 PM UTC+1, morten hattesen wrote:
      Reiner,

      How would you qualify Clay's posting containing these argument fragments?
      • This is the most childish, baseless attack I've ever read.

      A harsh commentary, but as it is commenting on the tone of the article and not the content of the article, it's on point. You may not agree with it, and it's harsh, and it lacks context, but it has nothing to do with Ad Hominem.
       
      • This is garbage

      In context, he is calling the article 'garbage' because it complains about performance of Fork/Join without having any benchmarking in it, which indeed seems quite ludicrous to me. 'garbage' is perhaps strong language, but it is the conclusion of commentary going to the heart of the piece, and thus, has nothing whatsoever to do with an Ad Hominem attack. It's entirely on point, even; it's insulting the article __based on an on-point line of reasoning__ and that is perhaps mean, but not logically fallacious.
       
      • All attack and insults and Java sucks
      From the few things I have read of OP, this is accurate. It goes to the very point of Clay's argument, in fact! Usage of insulting words do not imply insult, nor do they imply a logical fallacy.
       
      • This is just hateful trolling of the laziest and worst kind.
      There is a potential implication here that, because it is hateful and lazy trolling, that the article is not worth your time. This is dangerously close to the ground of Ad Hominem but still not a logical fallacy. If it went as far as: The arguments carried forth in the article are false because its author is a troll", THAT would be an ad hominem attack. The argument here is slightly different: "Your time is limited and based on the tone of the article, the way the author proliferates the article, and the reputation of the author, I advise you not to read it." This is not an Ad Hominem attack.
       
      • a big flaming pile of dung
      You are now quoting Clay out of context; Clay is paraphrasing the article, and is doing so more or less accurately.
       
      • hateful insults
      How is that an ad hominem? Clay states that he considers the content of the original article to be 'hateful insults towards java'. If you read into it that: "... and I am implying that the arguments set forth in it are wrong because the author is clearly a jackass, based on the fact that he writes hateful insults", then it would be an ad hominem attack, but what I take away from this line of thought is: "... and I am implying that putting criticism in the form of hateful insults is not sufficiently constructive to be worth investing time into", which isn't ad hominem.
      • you are trolling in the worst, laziest, and most disgusting way
      At this point Clay is indeed guilty of engaging in the use of flowery but in the end vapid hyperbole in an attempt to score some bonus points. This isn't the Ad Hominem logical fallacy but the logical fallacy of Hyperbole. This isn't a Socratic arena, it's an internet forum. Reaches for hyperbole, especially easily identifiable hyperbole like this, is simply Clay underscoring his opinions. It's a long way of writing, "No REALLY. I mean it!"
       
      • deeply embarrassed for posting this kind of thing

      What's logically fallacious about this statement? The fact that your feelings are hurt (or the OP's feelings are hurt) has nothing to do with logical fallacies, though part of the very point of Clay is that doing so is not conducive to constructive criticism. In that sense, Clay's own post isn't constructive either, but then he's perhaps just trying to talk in a language familiar to the original author.

      Insulting the poster (ad hominem) for insulting Java 8 Lambda implentation.


      This in a nutshell is where you are just plain wrong. Insulting people is not the same as 'ad hominem'. The essence of ad hominem is very very simple: "This argument is wrong because the person or people that support this argument are stupid / ugly / known poopyheads / anything else that is not material to the argument at hand". THAT IS IT. If I say:

      "Jack's suggestion that the moon is made of cheese is wrong because we have moon rocks that clearly show otherwise. Also, comet impacts on the moon would have behaved quite differently if it was. I furthermore posit that Jack is a giant idiot for even proposing this argument, and he should be ridiculed".

      Then I did NOT engage in an ad hominem attack. I did insult jack, though. This, however:

      "Jane's argument that X is a prettier letter than Y is false. She's very pretty and I don't trust pretty people, and I've seen her hang out with X a lot, therefore I conclude her argument couldn't possibly be correct."

      This is an ad hominem attack but not an insult.
       
      Reply all
      Reply to author
      Forward
      0 new messages