|
Description
The problem with C# and other mono programs, is that the "compiled code" isn't actually compiled at all. It is simplified into bytestreams (so kind of a simplified language) and then interpreted. This is possibly the main reason why Mono applications are much more resource intensive then others, and require more RAM. Because they are also trying to run an entire VM.
I propose that we make it possible for Mono applications to be properly compiled. Possibly with a bit of tweaking, the JIT-code could make a binary instead, eliminating the need for Mono to run in the background, reducing RAM usage significantly, which would speed up linux.
The use of C# ISN'T going to go away. We have to accept this. Many programs are being designed in C# unfortunately, and all we can do is find ways to make C# run faster and more efficiently, to appease the linux crowd.
Pretending mono doesn't exist isn't going to work. Its only a matter of time until some serious killer application is coded with it, and if that happens, we want it to run as fast as possible.
Tags:
(none)
Attachments
No attachments.
Duplicates
Comments
|
viraptor wrote on the 2 Oct 08 at 00:59
|
-1 Wrong
C# is compiled at runtime, so it is actually run from native code, not interpreted
`man mono` and look for '--aot' option if you want to have a native code binary generated on the disk instead
|
|
Auzy wrote on the 2 Oct 08 at 01:12
| |
Looks like you are right, but is Ubuntu using this method?
|
|
Remco wrote on the 2 Oct 08 at 01:34
| |
If it weren't it would be very slow. That's why Java was slow in 1995.
|
|
Auzy wrote on the 2 Oct 08 at 01:39
|
Remco, there is a difference between JIT and this. JIT compiles it when its run (so Converts the bytecode to compiled).
What I want is for the bytecode to be converted, and stored.. as an executable.. The option appears to allow this, however, is it what is done by default?
|
|
Remco wrote on the 2 Oct 08 at 02:02
|
I don't think it's done by default. You wouldn't gain much. The law of diminished returns tells you that you should only optimize the code that is used most often. The VM can do this by JIT-compiling hot code. It can actually use run-time information to optimize the code better than static compilation would allow.
Really, the only reason why you'd want to use a language such as C++ would be for the direct hardware access. I don't know of any VM that allows you to optimize for SIMD-instructions and stuff.
The only performance drop you'd notice with Java (I never used Mono) is when you start your app. It will also need to start the VM and load the classes, which takes slightly longer. But after that first second you're all set.
Actually, I'd first go for a JIT-compiler for Python programs, since those are used way more in Ubuntu, and Python is currently purely interpreted. Maybe a Bash compiler could be made, too. :)
|
|
Auzy wrote on the 2 Oct 08 at 02:33
| |
I dont personally use Mono either, however, there are many apps that do (including some tray applets I believe). Distributing apps with the precompilation already done, would allow them to start quicker, giving the OS an overall faster impression. Even if it is a small speedup, there probably isn't much advantage in distributing them as bytestreams anyway.
|
|
Emacs23 wrote on the 2 Oct 08 at 05:54
| |
viraptor, Auzy propose to get rid of jit compiler, but use compiler into machine code for c#. I think it's good idea.
|
|
rramalho wrote on the 2 Oct 08 at 09:00
|
One of the main differences of the Java Runtime vs .NET CLR is the startup time... the .NET CLR is *much* faster.
The executables generated by the compiler include one section for byte code and one or more sections for architecture. That's somewhere on Microsoft's docs about the CLR, if I recall correctly. Correct me if i'm wrong please.
But... Let's just "optimize" other things first please... =)
Optimize a common way to create programs for Linux, for instance... :)
|
|
boscorillium wrote on the 2 Oct 08 at 13:27
|
This is a bad idea for a number of reasons. First you now have to possibly distribute different versions of your program based on architecture and/or "bitness".
Nevermind that even when you differentiate between architecture and "bitness" you still have minor differences in processors. Since compilation happens at runtime Mono can theoretically optimize for specific processors. You would remove this possibility.
I personally like and use Mono a fair amount. Monodevelop is quickly becoming (if not already IMO) one of the premier development tools for the Linux desktop. In my mind it doesn't suffer at all from being JIT compiled app. It's quite good.
As an old school C++ programmer (it's a curse) I definitely sympathize with your idea, but I think it's a loss in the long run.
|
Post your comment
|