.NET Native Compilation Preview Released

Forum for any discussion not Dawn of Light related

Moderator: Support Team

.NET Native Compilation Preview Released

Postby rdsandersjr » Fri Apr 04, 2014 4:02 am

per slashdot - http://developers.slashdot.org/story/14 ... w-released

"Microsoft announced a new .NET compiler that compiles .NET code to native code using the C++ compiler backend. It produces performance like C++ while still enabling .NET features like garbage collection, generics, and reflection. Popular apps have been measured to start up to 60% faster and use 15% less memory. The preview currently only supports Windows Store applications, but is expected to apply to more .NET applications in the long term. A preview of the compiler is available for download now.
Thanks,
RDSandersJR
User avatar
rdsandersjr
Support Team
 
Posts: 1089
Joined: Fri Aug 01, 2008 3:01 pm
Location: Cincinnati, Ohio

Re: .NET Native Compilation Preview Released

Postby HunabKu » Fri Apr 04, 2014 4:22 am

Will can be nice, just wait it :-)
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: .NET Native Compilation Preview Released

Postby Graveen » Fri Apr 04, 2014 11:29 am

So .NET is up to 60% slower than traditionnal C++.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: .NET Native Compilation Preview Released

Postby Tolakram » Fri Apr 04, 2014 12:11 pm

Startup is faster, not sure anyone measured actual performance.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: .NET Native Compilation Preview Released

Postby Ephemeral » Fri Apr 04, 2014 3:35 pm

I think I'd rather just write things in C++ these days.. C11 makes it almost as nice as C# these days.
"The swarm is always smarter, faster and more adept than any actor which seeks to thwart it."
C++, Java, C#, VB.NET, ASM.
Current Project:
Engine Developer for The Red Solstice
User avatar
Ephemeral
DOL Freak
 
Posts: 554
Joined: Wed Mar 30, 2011 12:23 am

Re: .NET Native Compilation Preview Released

Postby Graveen » Fri Apr 04, 2014 8:05 pm

I think I'd rather just write things in C++ these days.. C11 makes it almost as nice as C# these days.
For one time i tend to share you point. I loved to work in c#, java, php, js, html+css... But every time i need to mock-up a quick and dirty, this is C or C++, i have no need of anything else than gcc and a text editor ! :) Sure i didn't like them for the same reason (difficult to love javascript or to consider html/css as a language...) but they all got something to show.

Don't misunderstand me, i appreciate all the power of nowadays IDE (views, refactoring, helpers...), but C++ is structured, powerful, and - thanks to libs availables - ready to use.. In one way, we could say C++ get over time powerful java/.net libraries while the managed language are running after C++ functionnality...
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: .NET Native Compilation Preview Released

Postby Blue » Fri Apr 04, 2014 10:39 pm

C++ is horrible for productivity :P

To write such important tools as Resharper for C++ is nearly mission impossible beyond simple rename refactoring.

... and did I mention C++ header files which are simply nonsense and code duplication? Don't get me started on compile times :lol:

C++ is an ancient language and C11 can only ease the pain.
But every time i need to mock-up a quick and dirty, this is C or C++
This, I totally can't understand. Mocking up something in C# is way quicker. It will take less keystrokes in the end - objectively taken. C# is such a nicely designed language that I even started to hate Java for not having C# features.
ex DOL Lead Developer
Blue
Uthgard Admin
 
Posts: 961
Joined: Wed Jan 21, 2004 11:07 pm
ICQ: 63977313

Re: .NET Native Compilation Preview Released

Postby Leodagan » Sat Apr 05, 2014 6:19 am

To get back to the subject,

I'm not sure this kind of Native Compilation will be a great feature for server softwares...

I tested the Mono AOT (Ahead of Time Compilation) which tries to link Cecil ByteCode to native Linux libraries, and can go further on some embedded devices to compile the ByteCode to a dynamic shared library too.

A lot of debug feature can't be used, and there isn't much (if even any) performances improvement on runtime, but I noticed some improvement on memory usage like the microsoft preview states (maybe due to not loading some heavy part of virtual machine, or leveraging the op-code caching...)

I can't say this is exactly the same level that microsoft is providing with their native compiler, but today's interpreter have made great improvements, and JIT can bring some features that native code can't (optimization depending on current dataset, results caching, using optimized code path depending on hardware without building all code path in the binaries... etc)

About different languages :

Yes C/C++ can be faster, but you have to write code really carefully and know how the compiler can optimize some part of your code to really take advantage of these language, writing some quick'n dirty code with C/C++ could bring more trouble than writing quick'n dirty managed code, and if you try to improve runtime of your app in C/C++ you'll need to rebuild binaries, use a new/better compiler and redistribute the app, a C#/Java/PHP/Python App can take advantage of their interpreter/JIT/GC improvements without needing to change anything in code or distributed package, end users just need to maintain the Virtual Machine/Runtime.

So if you feel like you're writing perfect code you can stay with C/C++ (or if it's needed for performance matter like writing a kernel driver...). But I honestly think that managed code allows to write the most logical code without thinking about optimizing code and give the "performance-optimization" job to the Runtime, allowing for easier maintenance of the soft, and taking advantage of JIT Compilers improvements for the future...

In DOL :

There are some part of DOL classes that are written like C/C++ Code (GameTimers with weird bit bucket array that are really hard to understand, PropertyIndexer with an own auto-expand algorithm and indexing array...) these show how some optimized code can get pretty hard to maintain, and the PropertyIndexer array even have some bug to use property ID above 254.

Using some common objects like Dictionary<T> or List<T> may lower performances or raise memory usage compared to pure integer or byte array, but at least when using common types, the interpreter can "understand" what I'm trying to do, and if it can be optimized it will do it (now or later), I don't have to think about implementation limits (obviously the PropertyIndexer have some flows...) I can rely on an implementation that allows for an "Int64"-Wide Index or Collection Size (no specialized code chunk...).
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: .NET Native Compilation Preview Released

Postby Graveen » Sat Apr 05, 2014 10:05 am

But every time i need to mock-up a quick and dirty, this is C or C++
This, I totally can't understand. Mocking up something in C# is way quicker. It will take less keystrokes in the end - objectively taken. C# is such a nicely designed language that I even started to hate Java for not having C# features.
Not what i mean in fact. Must be read as 'C/C++ is always available everywhere to start quickly'.
When you think "mockup involves GUI on Windows", C# is totally better. When dealing with drivers/low-level hardware such as USB or I2C, and sometimes on a different platform (embedded), you always have a C/C++ compiler and could quickly go for it.

Code duplication is totally, hrrrm, discutable. When dealing with headers and libs, you are working in an environment. Saying you could have mixed env or whatever is real, but why it should ? I don't catch what you exactly point.
The argument of counter-productivity is like comparing powerful/flexible vs integrated/easy-to-use: there are room for boths, and when you are used to, C++ simply works fine. There is a learning curve, yes, higher than c#, but it is really a problem when you are a pro coder ? What is more boring is the attention you must have on traditionnal problems, such as memory management, not exactly the environment or compilation toolchain configuration.

Last, but not least, ReSharper counterpart are existing for C++,(ie Visual Assist X). I could also mention Valgrind as a powerful tool for C side, but i will simply point the environment discussion is totally subjective, because you generally knows better the platform you are used to work.

Don't misread me: i love C# ease and features. But i consider the "old" languages as rock-solid, well structured and never being a waste to learn, because i'm sure in 5 years they 'll still be used, while i don't know about .NET :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: .NET Native Compilation Preview Released

Postby Graveen » Sat Apr 05, 2014 10:19 am

@Leodagan:

I think native compiler can be used to bring some desktop apps a performance boost, i don't think it is reliable to dev a whole solution with the goal to port it to native, for all the reasons you are giving.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: .NET Native Compilation Preview Released

Postby Ephemeral » Sun Apr 06, 2014 8:26 pm

Eh.. Let's face it, if your desktop app needs performance this badly, you didn't begin writing it in C# to start out.

Also blue, you do know that ReSharper is developing C++ features right now? :P

http://blog.jetbrains.com/dotnet/2013/0 ... support-c/

But in the case of current C++ helpers I prefer visual assist X
"The swarm is always smarter, faster and more adept than any actor which seeks to thwart it."
C++, Java, C#, VB.NET, ASM.
Current Project:
Engine Developer for The Red Solstice
User avatar
Ephemeral
DOL Freak
 
Posts: 554
Joined: Wed Mar 30, 2011 12:23 am


Return to “%s” Other Discussion

Who is online

Users browsing this forum: No registered users and 1 guest