Slashdot Mirror


Java IO Faster Than NIO

rsk writes "Paul Tyma, the man behind Mailinator, has put together an excellent performance analysis comparing old-school synchronous programming (java.io.*) to Java's asynchronous programming (java.nio.*) — showing a consistent 25% performance deficiency with the asynchronous code. As it turns out, old-style blocking I/O with modern threading libraries like Linux NPTL and multi-core machines gives you idle-thread and non-contending thread management for an extremely low cost; less than it takes to switch-and-restore connection state constantly with a selector approach."

8 of 270 comments (clear)

  1. Re:And this is news? by TommydCat · · Score: 3, Funny

    select() sucked the life out of me in the 90s and I don't think I'll ever recover...

    --
    This comment does not necessarily represent the views and opinions of the author.
  2. Re:And this is news? by osu-neko · · Score: 3, Funny

    Perl is not New Fangled. I am sorry to say Perl is one of those .COM languages that has sparked peoples interest for a few years but have settled down to niche language. So it is now an Old School Language... Sorry...

    :o

    GET OFF MY LAWN!

    --
    "Convictions are more dangerous enemies of truth than lies."
  3. Re:And this is news? by Titoxd · · Score: 2, Funny

    That still makes it a .COM language. As in COMMAND.COM, though...

  4. Re:And this is news? by Ossifer · · Score: 4, Funny

    Tape a piece of cardboard over it.

  5. Re:And this is news? by Anonymous Coward · · Score: 2, Funny

    With regard to Perl OO, I'm reminded of one of my favorite quotes, I think it's from Advacned Perl Programming. Requires some explanation for those not Perl nerds.

    For those unfamiliar, Perl's idea of "objects" are effectively just an OO framework on top of a procedural model. So you have packages, think C++ namespace. All a Perl object is, is a hash that is "blessed" into the package. You just call bless $hashref,package; and it makes it so you can do neat shit like $hashref->doShit, and then $hashref is just the first parameter. Well, part of this, and because it's just a hash reference...there is no encapsulation or protection...no private, no protected..etc.

    I was concerned about this, and the book I was reading noted someone might be. It's response was "Perl takes the approach that you should stay out of its living room because you're uninvited, not because it's holding a shotgun."

    That's Perl programming in a nutshell :)

  6. Re:Should be using Scatter/Gather +IOCP on windows by Anonymous Coward · · Score: 1, Funny

    The fastest way to write a bunch of buffers to disk is WriteFileScatter. The fastest way to read a bunch of data from disk is ReadFileGather.

    They're actually WriteFileGather and ReadFileScatter. APIs that scattered data around the disk would not be good for performance ;)

  7. Re:And this is news? by FoolishOwl · · Score: 3, Funny

    Some people are less afraid of SkyNet than they are of regular expressions.

  8. Re:True for JAVA, but not generally true... by Warll · · Score: 2, Funny

    I can say that I'm in charge of maintaining the software that terminates all HTTP traffic for Google. Draw your own conclusions.

    You're head of R&D for a supervillain's start-up attempting to kill the internet?