I've done similar benchmarking. On average, Java socket IO takes 3000 cpu cycles to handle a packet, including kernel time. That isn't bad for TCP which is a complex protocol.
Java NIO implementation easily adds another 1000 cycles on top of that. It tries to provide too much abstraction and it does excessive locking.
Therefore, Java NIO is about 25% slower, it looks like, in a naive saturation test.
But it's meaningless. 1000 cpu cycle is nothing in a java program. Let's do the simplest non-trivial thing with the data, say, xor each bytes. That's about 2 cycles per byte, and 2000-3000 per packet. That's another 50% slowdown. A real application needs to do much much more than that, and the overhead of Java NIO becomes negligible.
NIO is better if there are a lot of connections blocked on read/write. But this is odd if you really think about it! Why couldn't thread impl achieve the same thing? As of today, the only reason is that thread stack size is fixed and quite large. Java's default stack size is 256K. A few thousands of threads will consume all the memory on board. If you maintain connection state yourself, it's far smaller than that, and it pays to not create one thread for every connection.
one theory says that since iPhone4 makes antenna design, especially the gap, so prominent, it is far easier for people to correlate signal quality with hand position.
on other phones, even if the same problem exists, it is very difficult for people to discover, because the antenna is internal. drop of signal is so common, you just won't think too much about it.
the lesson is, if you have a design flaw, obfuscate it so that people can't easily identify the cause.
*that* statement is quite trivial and can be easily proven in Newton's dynamics, there is nothing magical about it.
what Einstein did is to generalize it, and claim that no experiment can distinguish the two reference frameworks. that leads to new theories, for example, light bends in gravity.
Some college dudes *talk* about building a software sometime in future, without any details, and that becomes huge news? The world is already SATURATED with softwares like that.
1st, you can't get any unemployment check if you resigned.
I'm not surprised he left java. the direction of java is clearly out of the control of the fathers of the language, their design principles cannot withstand pressure from the "community" who want shinny new things without considering the consequences.
As the son of the IRS employee who was killed in this incident said, "if he [Stack] has a house and a plane he can pay his taxes." (Austin American-Statesman, 2/21/2010).
If his father is a decent human being, he wouldn't become a tax man and he wouldn't die in this incident.
I want to understand why this is modded "insightful"? It's basically "you are wrong and stupid" without providing any further explanation. Name calling isn't "insight".
It means we can breathe easy that a lot of crypto out there is now provably secure.
Wrong. It doesn't prove that there is no faster factoring algorithm.
shut up and mod me up.
I've done similar benchmarking. On average, Java socket IO takes 3000 cpu cycles to handle a packet, including kernel time. That isn't bad for TCP which is a complex protocol.
Java NIO implementation easily adds another 1000 cycles on top of that. It tries to provide too much abstraction and it does excessive locking.
Therefore, Java NIO is about 25% slower, it looks like, in a naive saturation test.
But it's meaningless. 1000 cpu cycle is nothing in a java program. Let's do the simplest non-trivial thing with the data, say, xor each bytes. That's about 2 cycles per byte, and 2000-3000 per packet. That's another 50% slowdown. A real application needs to do much much more than that, and the overhead of Java NIO becomes negligible.
NIO is better if there are a lot of connections blocked on read/write. But this is odd if you really think about it! Why couldn't thread impl achieve the same thing? As of today, the only reason is that thread stack size is fixed and quite large. Java's default stack size is 256K. A few thousands of threads will consume all the memory on board. If you maintain connection state yourself, it's far smaller than that, and it pays to not create one thread for every connection.
Pentagon should have an internal porn library with all kinds of flavors, so the employees won't be subject to blackmails from outside.
how many hand positions you use when making calls? one.
one theory says that since iPhone4 makes antenna design, especially the gap, so prominent, it is far easier for people to correlate signal quality with hand position.
on other phones, even if the same problem exists, it is very difficult for people to discover, because the antenna is internal. drop of signal is so common, you just won't think too much about it.
the lesson is, if you have a design flaw, obfuscate it so that people can't easily identify the cause.
researchers in universities are seriously out of ideas of what to research
todays' news about NASA is that its primary function is to make muslims happy.
of course, you won't see that on Slashdot, MSNBC or Huffintonpost.
Do you like to ask questions? Of course. Do you like to answer your own question immediately? Absolutely.
anyone who lament the lack of far left in America, is a far left.
once Obama took the office, obviously no soldier had died. He really is God.
*that* statement is quite trivial and can be easily proven in Newton's dynamics, there is nothing magical about it.
what Einstein did is to generalize it, and claim that no experiment can distinguish the two reference frameworks. that leads to new theories, for example, light bends in gravity.
Dr. Evil isn't motivated by money either, and he wants to change the world too.
Obama saved our country.
Why can't they just use the *real* history book like Californians do?
CmdrTaco, are you retarded?
Some college dudes *talk* about building a software sometime in future, without any details, and that becomes huge news? The world is already SATURATED with softwares like that.
Our society has severe discrimination against heterosexual females.
1st, you can't get any unemployment check if you resigned.
I'm not surprised he left java. the direction of java is clearly out of the control of the fathers of the language, their design principles cannot withstand pressure from the "community" who want shinny new things without considering the consequences.
Even if your argument is valid for average police forces, Chicago police is the most corrupted in the country.
If his father is a decent human being, he wouldn't become a tax man and he wouldn't die in this incident.
He's a communist Californian.
I want to understand why this is modded "insightful"? It's basically "you are wrong and stupid" without providing any further explanation. Name calling isn't "insight".
twitter wasn't scalable at all even long after it became famous.
don't buy this book. only 12.5 people on the earth need to know scalability, and they don't need to read this book either.
You left out "Family Guy". That show is child+animal+incest+homo porno. But obviously Americans love it.
because there's a downside: https can make your browsing slower since encrypted data doesn't travel across the web as quickly as unencrypted data.
you can complain about those mother fuckers or you can fuck your own mother.