TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Performance-Wise, C# Trumps Java

25 pointsby tkelloggover 12 years ago

19 comments

hkarthikover 12 years ago
As a recovering C# programmer, I can safely say the cost of licensing and tooling is the main detriment, along with cross platform issues.<p>Working on C# OSS means stealing licenses from your employer, buying an MSDN subscription on your own dime, or evangelizing enough to get an MVP award so you get all the tooling for free. The free Express editions of the tools have built in limitations that don't make them viable for building Big Data projects. Other options exist, but pale in comparison to Visual Studio so they don't get much use.<p>As for mono, the uptick for the OSS stuff just isn't there and even Xamarin is leaning on commercial offerings to become a viable business. Maybe as they get more successful they can sponsor some C# server projects, but that may be a ways off.<p>This is all unfortunate, as C# really is a great language.
评论 #5239115 未加载
评论 #5239129 未加载
评论 #5239287 未加载
评论 #5239167 未加载
btillyover 12 years ago
It answers it at the end. When it comes to big data, if you don't run on Linux, you don't run.<p>Tech people who have to handle that kind of data and that kind of volume generally don't want to pay a Microsoft tax. In theory there are a lot of other alternatives. However all of the popular ones are Unix based and either are native to, or ported to, Linux.<p>There are exceptions. For example eBay decided for political reasons to go the Windows/Java route some years ago. (And reportedly paid a factor of 2 cost differential for it.) But Google, Facebook, Amazon, etc see no reason to be dependent upon Microsoft, or to pay that level of tax to a potential competitor.
kevingaddover 12 years ago
Structs and erasure-free generics definitely make C# faster in principle, but I don't think that's necessarily enough to overcome the huge amount of work that has gone into making the JVM JIT fast code and giving it a world-class garbage collector. I don't think it makes sense to assume that it would be faster for 'big data' use cases unless you've tested it.<p>Furthermore, I doubt straight-line execution performance is really the biggest concern when choosing a language to use for a task like this. You probably want to prioritize being able to find people who know the language - or, if you're using existing staff, you pick something they either know or can learn easily. C#'s not hard to learn but the odds are better that your typical CS graduate knows Java. In particular, if you want high performance, high performance C# isn't particularly easy to write - you'll have to know the language well, just like in any other environment.
评论 #5239206 未加载
评论 #5239104 未加载
0x0over 12 years ago
My guess is that a lot of big data is deployed on linux, and thus the development environment as well as the well known deployment routines on linux revolves around tools that traditionally work well on Linux, like the headless JRE (for the servers) and Eclipse/Netbeans/IntelliJ (for the development environment).<p>Can you even set up a bunch of windows server nodes without running into a licensing headache?
评论 #5239030 未加载
评论 #5238943 未加载
phren0logyover 12 years ago
If I were working with mountains of data in the .Net ecosystem, I'd have my eye on F# more than C#. In fact, F# is the only thing that makes me jealous of that tool chain.
评论 #5239145 未加载
评论 #5239248 未加载
naranhaover 12 years ago
Well the article's title is a bit misleading, since it does not try to proof that C# is actually faster than Java, it just argues that C# is better as a language. The reality is that C# and Java are pretty close and even if C# was twice as fast, it wouldn't be significant. C# may be a nicer language to work with, but Java's cross platform capabilities are a stronger argument for me. Mono on the other hand is a lot slower than Java on Linux.
Uchikomaover 12 years ago
I pity our industry, Bold claims "Performance-Wise, C# Trumps Java", no data.<p>TL;DR Don't look at data, look at the principles. Ignore reality, think about how the world should be. I think as an industry we can't aim lower than this quote:<p>"In fact, C# is a better fit than Java for high-performance requirements. I'm not referring to VM stats that change every year. C# has been designed from the ground up with efficiency in mind."<p>And a side note:<p>"Both C# and Java have generational mark and sweep collectors."<p>No Java hasn't.
评论 #5239281 未加载
bhauerover 12 years ago
Although I've not extensively used it, I like the features C# has over Java, and that was especially true before Java borrowed back many of those ideas in its later versions.<p>However, I clicked on this article expecting to see some performance benchmarks to justify the title. Rather, I see some theory about why it MIGHT be faster and also some opinions about what features might make a developer more efficient in C# than Java. I worry that any actual benchmarks would not validate the title. Certainly the web application benchmarks I've seen elsewhere do not align with the title.<p>Ultimately, it seems to partially conflate performance with developer efficiency. Developer efficiency I am willing to concede: C# may be more developer friendly as a language, putting platform aside.
irahulover 12 years ago
May be people will pick up C# for non windows projects in the future, but the past just wasn't favorable for it.<p>The first version of C# was a 'meh' - Microsoft's Java(I already know Java; why bother?). C# got interesting(and a better Java IMO), but it took time. C# didn't have package management concepts till late(nuget is still in its infancy), and small to non-existent open source ecosystem. For a long time, it didn't run on anything else but Windows. Hobbyist who weren't willing to buy Windows(doesn't matter much if it comes with your system) and VS licences(express edition came late and explicitly disallows commercial use) didn't try C#.
评论 #5239183 未加载
thepumpkin1979over 12 years ago
Nice to see Xamarin making it's way in the mobile space, however, I have the theory that if there were a Mono distribution(installers, packages, etc) that favored other file extensions than ".exe" and ".dll" along with web frameworks designed for Command Line(like rails), only then Unix/Linux developers could see Mono as a serious Java alternative at least for Server-Side. I'd support an effort to create a separate Mono distribution that strips down GTK#, ASP.NET and family to a minimal Base-Class-Library powered by an amazing Runtime/JIT technology. If only I could find more developers who think this way...
blibbleover 12 years ago
easy: having your machines cost 50% more due to the Microsoft tax makes the entire point of having bucket-loads of cheap hardware utterly irrelevant.
kevingaddover 12 years ago
Why did the mods just edit the 'big data' detail out of the title? Now this just looks like a link to a benchmark?
macca321over 12 years ago
Just to say, you can get a free copy of VS2012 Pro through the WebSiteSpark scheme, which has a tiny-weeny barrier to entry.<p>I've had legal copies of VS for years through this.
评论 #5239194 未加载
manojldsover 12 years ago
C# is amazing as a language. I love the static typed as much as possible and dynamic where needed part that the OP mentions. My library leverages that aspect of it, if anyone is interested in having a look - <a href="https://github.com/manojlds/cmd" rel="nofollow">https://github.com/manojlds/cmd</a><p>To the comparison with JAVA - C# is not really cross-platform. I wish for C# on the JVM. Hope that becomes true someday.
评论 #5239103 未加载
tgflynnover 12 years ago
C# is essentially Windows only and Windows is not a good platform for heavy data analysis.<p>Windows has many problems but one of the worst is poor file system performance. On Windows you waste a lot of time moving large files around when you would hardly notice these times on Linux.
评论 #5239054 未加载
moron4hireover 12 years ago
I love C# as a language, I am constantly finding new ways to use it, along with well-thought out restrictions that really help to avoid abusing it. The generics issue you mentioned, along with the lack of lambdas in Java (which is why I think languages like Clojure and Scala have gotten popular) are the two biggest reasons Java is a serious no-go for me. Java is a strictly typed language that makes dealing with types hard. C# is a strictly typed language that makes dealing with types easy.<p>The problem is that there is no community behind it. The vast majority of C# programmers are do-the-bare-minimum-contractors who hang up their keyboard at the end of the day and go home to their Top Chef and NFL on TV. Those people don't contribute to anything in any community, let alone the open source community.<p>There are a lot of ways to be able to do C# for free, both as in libre and as in gratis. Mono has about as big of an OSS community behind it as you will find in C#, and it even has support from Microsoft. The language itself is an EMCA standard, and much of the CLR VM and runtime library are, too. The parts that aren't OSS in the library have very reasonable alternatives, in fact, even if OSS wasn't a concern for you, those alternatives are so good you should probably be using them anyway.<p>And it's in almost every package repository out there, certainly all of the ones I've tried. I personally think setup is a sight easier than Java. I've personally found it a little easier to get setup with Mono that with Java; there is some fragmentation in Java that, while not insurmountable, is still a small annoyance.<p>Yes, you're not going to get a great IDE for it yet. MonoDevelop is buggy in weird ways. You could cheat and run VS Express in WINE, but I have a feeling some people are going to have a problem with that for no good reason other than to have a reason to complain.<p>I'd say, if you're the type of developer that is capable of putting together her entire toolchain from the ground up, C# is one of the best languages out there and it's a shame more people don't consider it. If you need hand-holding, then yes, it's really hard to do C# well on anything other than Windows. It's getting better, and will continue to grow, so don't discount it completely.
评论 #5244718 未加载
Associat0rover 12 years ago
Because F# <a href="http://www.infoworld.com/d/application-development/microsoft-big-data-programmers-try-f-211914" rel="nofollow">http://www.infoworld.com/d/application-development/microsoft...</a>
TeeDubover 12 years ago
Are there any serious benchmarks that compare the performance of Java and C#. As someone who works with both languages, I can generally but the qualitative arguments that the author is making, but I would really like to see some data...
nvkover 12 years ago
Why?<p>A: MS Tax to run it.