Hacker News new | past | comments | ask | show | jobs | submit login
LLVM-powered Mono (tirania.org)
47 points by pieter on July 16, 2009 | hide | past | web | favorite | 8 comments

What is the cost to the project of maintaining their own JIT optimizing compiler? I presume, knowing nothing of LLVM other than what I have read, that it will continue to improve in performance with or without Mono or any other single platform on top of it. Let's presume that the Mono developers switch to LLVM as their sole target platform. What else could they spend their time on if they don't have to worry about a JIT?

Note that I'm not necessarily asking these questions rhetorically -- I don't know a lot about this technology stack and want to validate my core assumptions.

I think it depends. LLVM is a very large project which adds a significant overhead to your footprint. LLVM also historically has focused on "normal" (i.e. AOT) compilation so is more concerned about generating good code even if it takes a while (which isn't the main focus for MS CLR, or Mono's JIT). LLVM have improved their x86 -O0 perf, but it's still not as fast as the fast path on JIT-focused backends.

So, yeah, there's a cost. Depends what the end user is using Mono for as to whether it's worth it or not I guess.

From the posting: "This extra performance comes at a cost: it consumes more time and more memory to JIT compile using LLVM than using Mono's built-in JIT, so it is not a solution for everyone."

So, faster code but more memory usage and longer JIT time seems to be the reason why mono didn't just switch over to LLVM.

My bet is that they'd switch if LLVM supported the same features and architectures as their own, but just with better results.

My assumption according to this article that this JIT compiler focuses on IO.

But computationally intensive applications will definitely benefit from this. Financial and scientific users will surely appreciate this performance boost.

Or... uhm.... game developers...

Seems like it would be nice to apply LLVM -O3 selectively, perhaps with some kind of pragma/directive in your code, and use the mono JIT as usual for the rest. Is this a possibility? I often know where my performance hotspots are, but switching languages and writing an external library in C is a drudgery. Would it be possible to get close to gcc/C performance for some restricted subset of C# when compiled with LLVM?

There have been some talks since the announcement of Mono.SIMD about providing JIT hints.

There is a partial patch on mono's mailing list archives that provides initial infrastructure for querying for those hints. The initial idea was to provide inlining hints for caller and callee.

If you feel inclined to have such thing, please drop by our irc channel or mailing lists to discuss this and contribute some code.

LLVM is not able to support some of the features that Mono needs, so in those cases the JIT compiler will still fall back to Mono's JIT engine (methods that contain try/catch clauses or methods that do interface calls).

Who uses exceptions, anyway?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact