Domain: techempower.com
Stories and comments across the archive that link to techempower.com.
Comments · 18
-
Re:Iteration, Openness
Running on Linux with
.NET is literally 100 times slower than just using Java. Why would you? See here: http://www.techempower.com/ben... -
If you want .NET for a web-app I show you the door
See the following benchmarks why.
Java. Much more widely available, much larger ecosystem, deployed where it matters,...
Just some numbers from a Dell R720xd dual-Xeon E5 v2 + 10 GbE: http://www.techempower.com/ben...
Throughput:
Java: 831,515 responses per second vs .NET: 108,543 (and that is with a pure .NET http listener, you don't even want to know the numbers using normal .NET mechanisms)
Or Latency:
Java 0.4ms vs .NET http listener: 10.1ms
See, these are worlds apart. Or google "London Stock Exchange .NET", which was a monumental fail even MS invested Millions in that poster child project. Result: CEO fired and now on Linux in C++. Google it, very funny story.
And I was very fair to .NET, I took the fastest .NET variant but the standard Java ones. There are better Java ones. And I took the Json benchmark. E.g. in Cleartext benchmark it would be Java undertow 4.16M resp/sec vs .NET 110k resp/sec, that is 40 times less for .NET. Of course the winner of the benchmarks is C++ (e.g. 6.7M resp/sec for Cleartext benchmark). -
IDE and compiler on mobile???
What IDE shall I use? Does it have an IDE and compiler on Android? So if I teach Java students could do their homework on their phone or tablet. What about VB?
Also mono is even slower than .NET (which already can easily be 40-100 times slower than Java on powerful servers). Look for mono in the following benchmarks: http://www.techempower.com/ben... -
benchmarks say you are very wrong
If you come to my company and say you want to create a large web-app in
.NET I show you the door. See following benchmarks why.
Java. Much more widely available, much larger ecosystem, deployed where it matters,...
Just some numbers from a Dell R720xd dual-Xeon E5 v2 + 10 GbE: http://www.techempower.com/ben...
Throughput:
Java: 831,515 responses per second vs .NET: 108,543 (and that is with a pure .NET http listener, you don't even want to know the numbers using normal .NET mechanisms)
Or Latency:
Java 0.4ms vs .NET http listener: 10.1ms
See, these are worlds apart. Or google "London Stock Exchange .NET", which was a monumental fail even MS invested Millions in that poster child project. Result: CEO fired and now on Linux in C++. Google it, very funny story.
And I was very fair to .NET, I took the fastest .NET variant but the standard Java ones. There are better Java ones. And I took the Json benchmark. E.g. in Cleartext benchmark it would be Java undertow 4.16M resp/sec vs .NET 110k resp/sec, that is 40 times less for .NET. Of course the winner of the benchmarks is C++ (e.g. 6.7M resp/sec for Cleartext benchmark). -
Re:Why bother?
Sorry, I was only considering non-GUI applications since that's the playground I know. I realize benchmarking is complex and difficult territory to traverse, but for example at http://www.techempower.com/ben... the best Java implementations consistently beat the best IIS+C#, though admittedly not be a lot. I'm not aware of public, reproducible benchmarks on Windows JVM + Tomcat vs. CLR + IIS - and I'm assuming if they existed and showed CLR doing well, Microsoft would be shouting them from the rooftops.
I agree that for mobile, it makes more sense to use HTML5 + Javascipt wherever it can fit.
I don't love Java or Oracle, I just consider them less of an evil in the 1980+ history of computing than Microsoft. (And "more evil than Oracle" is a high bar to cross.) -
Re:why would I write to that?
No, true Scotsman here. I linked to proof that you can normally serve 10 times more clients on a similar Java implementation on very powerful servers. Here the link again: http://www.techempower.com/ben...
-
Re:why would I write to that?
.NET ecosystem is very small if compared to Java. And many projects are just ports of Java stuff, payed by MS because otherwise the ecosystem would be even smaller. And look at performance,
.NET is a joke for anything serious: http://www.techempower.com/ben... -
Re:why would I write to that?
sorry, correct link: http://www.techempower.com/ben...
-
Re:why would I write to that?
.NET for webapps is just a Joke. Look at the following benchmarks:
Java. Much more widely available, much larger ecosystem, deployed where it matters,...
Just some numbers from a Dell R720xd dual-Xeon E5 v2 + 10 GbE: http://www.techempower.com/ben... [techempower.com]
Throughput:
Java: 831,515 responses per second vs .NET: 108,543 (and that is with a pure .NET http listener, you don't even want to know the numbers using normal .NET mechanisms)
Or Latency:
Java 0.4ms vs .NET http listener: 10.1ms
See, these are worlds apart. There is no large scale .NET app I know of (seeing these numbers you would be nuts to try it). Except "London Stock Exchange", which was a monumental fail even MS invested Millions in that poster child project. Result: CEO fired and now on Linux in C++. Google it, very funny story.
And I was very fair to .NET, I took the fastest .NET variant but the standard Java ones. There are better Java ones. And I took the Json benchmark. E.g. in Cleartext benchmark it would be Java undertow 4.16M resp/sec vs .NET 110k resp/sec, that is 40 times less for .NET. Of course the winner of the benchmarks is C++ (e.g. 6.7M resp/sec for Cleartext benchmark). -
Re:why would I write to that?
.NET for webapps is just a Joke. Looks at the following benchmarks:
Java. Much more widely available, much larger ecosystem, deployed where it matters,...
Just some numbers from a Dell R720xd dual-Xeon E5 v2 + 10 GbE: http://www.techempower.com/ben...
Throughput:
Java: 831,515 responses per second vs .NET: 108,543 (and that is with a pure .NET http listener, you don't even want to know the numbers using normal .NET mechanisms)
Or Latency:
Java 0.4ms vs .NET http listener: 10.1ms
See, these are worlds apart.
And I was very fair to .NET, I took the fastest .NET variant but the standard Java ones. There are better Java ones. And I took the Json benchmark. E.g. in Cleartext benchmark it would be Java undertow 4.16M resp/sec vs .NET 110k resp/sec, that is 40 times less for .NET. Of course the winner of the benchmarks is C++ (e.g. 6.7M resp/sec for Cleartext benchmark). -
Updated benchmarks on real servers...
There is a newer benchmark round 9 with "real" servers (Dell R720xd dual-Xeon E5 v2 + 10 GbE instead of I7 + 1 GbE). This did not go well for
.NET and Windows:
Benchmark with "real" servers:
- Throughput for Java went from 200k responses per second to over 800k (even 915k for gemini), it stayed more or less the same with .NET (108k for pure .NET listener)
- Minimum latency Java went from 1.2ms to 0.3-0.4ms. For pure .NET listener 10.1ms, so better hardware does not help you here either.
As you see, .NET and Java do not play in the same league, not even the same game if it is about large fast stuff.
Note: standard IIS and ASP are not longer tested. It would look too sad for them...
Note: yes you will cry "fan boy" again, but these are the hard facts, learn to live with it. -
See why .NET is no option in big business Apps...
See the benchmarks:
- Minimum latency for each framework (1.2 ms vs much more)
- Throughput (200k vs at most half that), requirements...
- Alone this two points make .NET a hard sell to informed customers (if they need large fast stuff). And then there is vendor lock-in and available hardware (need a 1024 core machine for your solution, good luck if it is on Windows).
Note: mono numbers are even much worse, so no option for anything serious.
Note: MS shills are going to hate this post, please help to save it, thanks :-* -
Why not use C# for large business App
Just check benchmarks, e.g. vs Java:
- Minimum latency for each framework (1.2 ms vs much much more)
- Throughput (200k vs at most half that), requirements...
- Alone this two points make .NET a hard sell to informed customers (if they need large fast stuff). And then there is vendor lock-in and available hardware (need a 1024 core machine for your solution, good luck if it is on Windows). -
Re:Troll much, slashdot?
Read the benchmarks at http://www.techempower.com/benchmarks/ and http://benchmarksgame.alioth.debian.org/
Well-written Java code running on the JVM long enough for the Hotspot Just-In-Time (JIT) to optimize it consistently runs within 2x of the speed of well-written C++ code. The JVM uses more memory, in some cases as much as 40 times more. But for speed, Java is awfully close to C++ and positively demolishes PHP.
If you don't believe it, find counter-benchmarks. -
Re:Who you gonna call?
No benchmark is flawless, but look at the computer language shootout ( http://benchmarksgame.alioth.debian.org/ ) or the TechEmpower web benchmarks ( http://www.techempower.com/benchmarks/ ) Java does very well in both. In the computer language shootout, in all eleven micro-benchmarks Java finishes within a factor of two of C++ - it uses dramatically more memory, but it runs very nearly as quickly.
In the TechEmpower benchmarks, in a few places the lone C++ entry has a strong lead, but nowhere does it trump the well-written Java entries by as much as a factor of three, and in some places it loses soundly to some Java entries.
Now there are a large number of applications when a 2-3x loss of speed are unacceptable and a much larger number of applications when a 5-40x increase in required memory are unacceptable. And the Java Virtual Machine HotSpot Just-In-Time compiler starts optimizing functions that have been entered 10,000 times, so for the first few seconds or minutes of operation a Java program runs more like an interpreted language than not.
So you have to ask yourself whether Java occupies the sweet spot between the execution speed of C++ and the developer productivity of, say, Python, Ruby, Perl, and PHP. I would say... no. But that's a much more complex topic to debate. I suspect the real sweet spot might be languages like Clojure and Scala, which hit all of the strengths of the Java Virtual Machine, tie in easily to existing Java libraries, but are much nicer to work with than Java itself. -
Re:Why not something normal?
Or how about we all just drop Java since it's terrible and the cause of too many security problems?
Java on the browser very much corresponds to the cliche of the horribly misshapen monster moaning "please... kill me". Java - or at least the JVM - outside the browser seems to be doing fine. Scala, Clojure and Groovy are thriving, and starting to get mature, Kotlin is hot. Java frameworks are doing really well in webframework performance. The JVM might be in better shape than ever at the moment.
-
Re:Java is SLOW
> Java is slow*
As others have noted, this is completely wrong. Java bytecode, over a JVM in server config, after the JIT warmed up (which is the case for web apps), is very close to C++ in performance.
> Google/Youtube use python
Only for select portions of the site that see regular updates or have little logic (uploads, the labs potions etc). For the rest, they use a lot of Java, along with C and now Go.
Python and PHP web sites can be quite scalable. This is not because Python and PHP are themselves fast (they are 5-20 times slower than Java when run pure), but because most of the work is in fact done over C extensions (Python regex is actually a tad faster than Java regex because it uses a native module). If most of the CPU time is spent applying templates rather than any per-page logic, simply switching to a native templating engine works wonders. This is fine. I don't care where my code is run as long as I don't need to write managed code and I use Python a lot for scientific code without speed problems.
To query a database, run an XPath query, call a scientific extension or apply a template with native cheetah template engine, Python won't be much slower than C. But logic in Python itself is SLOW and it shows in a tight loop (not something web sites do much of anyway). So Python makes it easy to write C extensions without getting hands dirty (Cython, Shedskin etc). Put in another way, Python is a slow language (implementation, really) that does not let the slowness get in the way, most of the time. Same goes for PHP.
> * Yes, I know *in theory* in a certain very limited set of circumstances Java can be faster than compiled code, but the theory doesn't actually match the practical reality of the situation.
Many Java web frameworks do a lot more stuff than typical PHP setups. For example, I use ZK. It maintains the entire client UI model on the server. This is definitely not meant to scale. But the abstractions save me a lot of work for what I want to do.
Here are some recent benchmarks on how Java and PHP perform under load, especially when straight Servlets are used. No comparison.
http://www.techempower.com/blog/2013/03/28/framework-benchmarks/
http://www.techempower.com/blog/2013/04/05/frameworks-round-2/> Disclosure: I run a high traffic website that get's millions of page views a day. Uses Yii php framework
But what does your site mostly do? Just serve static content for most part? with the pages filled with some straight-forward queried content? Yii framework looks like a basic MVC framework with few additional abstractions. It should not matter what language you use for something like this. I suspect that the same would be true for the OP. I don't disagree with your conclusions, just not for the same reasons.
The final advice to OP: Start with whatever takes the least capital. There are frameworks that have plugins for most of the common web stuff (Rails, Grails etc) and these are the right places to get started quickly. Hundreds of thousands of visitors/day is not much for modern machines. Even if the site is 20 times slow, clustering to 20 servers is cheaper if the slower, but more productive technology saves one developer year of work. A little optimization later will probably give you a lot of mileage later. Switching to a scalable architecture, using technology built for scalability like Go, Hadoop and NoSQL/HBase won't need to be concern until one is rolling in cash. They need more expensive devs. Premature optimization and all that.
-
Re:Java is SLOW
> Java is slow*
As others have noted, this is completely wrong. Java bytecode, over a JVM in server config, after the JIT warmed up (which is the case for web apps), is very close to C++ in performance.
> Google/Youtube use python
Only for select portions of the site that see regular updates or have little logic (uploads, the labs potions etc). For the rest, they use a lot of Java, along with C and now Go.
Python and PHP web sites can be quite scalable. This is not because Python and PHP are themselves fast (they are 5-20 times slower than Java when run pure), but because most of the work is in fact done over C extensions (Python regex is actually a tad faster than Java regex because it uses a native module). If most of the CPU time is spent applying templates rather than any per-page logic, simply switching to a native templating engine works wonders. This is fine. I don't care where my code is run as long as I don't need to write managed code and I use Python a lot for scientific code without speed problems.
To query a database, run an XPath query, call a scientific extension or apply a template with native cheetah template engine, Python won't be much slower than C. But logic in Python itself is SLOW and it shows in a tight loop (not something web sites do much of anyway). So Python makes it easy to write C extensions without getting hands dirty (Cython, Shedskin etc). Put in another way, Python is a slow language (implementation, really) that does not let the slowness get in the way, most of the time. Same goes for PHP.
> * Yes, I know *in theory* in a certain very limited set of circumstances Java can be faster than compiled code, but the theory doesn't actually match the practical reality of the situation.
Many Java web frameworks do a lot more stuff than typical PHP setups. For example, I use ZK. It maintains the entire client UI model on the server. This is definitely not meant to scale. But the abstractions save me a lot of work for what I want to do.
Here are some recent benchmarks on how Java and PHP perform under load, especially when straight Servlets are used. No comparison.
http://www.techempower.com/blog/2013/03/28/framework-benchmarks/
http://www.techempower.com/blog/2013/04/05/frameworks-round-2/> Disclosure: I run a high traffic website that get's millions of page views a day. Uses Yii php framework
But what does your site mostly do? Just serve static content for most part? with the pages filled with some straight-forward queried content? Yii framework looks like a basic MVC framework with few additional abstractions. It should not matter what language you use for something like this. I suspect that the same would be true for the OP. I don't disagree with your conclusions, just not for the same reasons.
The final advice to OP: Start with whatever takes the least capital. There are frameworks that have plugins for most of the common web stuff (Rails, Grails etc) and these are the right places to get started quickly. Hundreds of thousands of visitors/day is not much for modern machines. Even if the site is 20 times slow, clustering to 20 servers is cheaper if the slower, but more productive technology saves one developer year of work. A little optimization later will probably give you a lot of mileage later. Switching to a scalable architecture, using technology built for scalability like Go, Hadoop and NoSQL/HBase won't need to be concern until one is rolling in cash. They need more expensive devs. Premature optimization and all that.