Welcome Guest, you are in: Login

Nutbox.org

RSS RSS

Navigation



Search Nutbox.org
»

PoweredBy

Efficiency

RSS
Modified on 2011/11/07 20:56 by Administrator Categorized as Uncategorized
Let me say this first:

  1. .NET applications are translated into native code using a Just-In-Time compiler that is very fast.
  2. .NET applications run at nearly the speed of native programs.
  3. .NET applications run much faster than most people are willing to suspect.

To be honest, I don’t give much about efficiency these days.  There was a time when I coded Intel 80386+ protected mode assembly language and spent hours squeezing out every last tick, but these days are over.

Today, people are routinely using 2+ GHz dual-core processors with two or four gigabytes of RAM.  So I code for coding efficiency, not for execution efficiency.  As a rule of thumb, you’ll never notice (even I am surprised how quickly .NET applications execute – even when written as straightforward as possible).  The only case that I am a bit sad about is the dircmp utility, which can easily suck up 200 megabytes of memory when comparing two hard disks.  If somebody feels like rewriting {[dircmp}} or to provide me with efficiency patches, please go ahead.  I don’t promise I’ll use them, but you’re welcome to give it a try.

With C# and .NET, I can code and test something like three to five tools in a span of eight hours.  That’s almost as rapid as when writing in Python.  Admitted, the tools are a bit simple and often do things the least efficient way, but you can’t tell, can you?

I can only say that if you are new to .NET or you know next to nothing about it, please set aside a few hours to research this remarkable and extremely useful technology from Microsoft.  I’ve been loathing Microsoft for decades, but it seems that their enlistment of Anders Hejlsberg, yet another famous Dane (there’s also Bjarne Stroustrup, the creator of C++), has given Microsoft pretty much all the strategic and architectural thinking that Borland used to excel at.  Sadly enough, I myself disregarded .NET as “yet another Microsoft enslavement technology” right out of the box and therefore have wasted some five or ten years not getting to know .NET intimately.  I cope.  But I am saddened nonetheless :-)  The fact is that Mono exists and therefore .NET cannot possibly be yet another enslavement technology.  With Mono, you’re assured that your .NET programs are going to run forever even if the unthinkable happened and Microsoft went bankrupt.

But the bottom line is that .NET is very efficient.  Try out the view tool (a very, very inefficient tool) under Linux, and you’ll see what I mean: .NET APIs are translated into ncurses APIs and yet it all goes so fast that the application feels as a native Linux application.

If you are new to .NET be prepared for a big surprise: .NET rocks and is reasonably fast and at the same time a wonderful dream to code up against.  To illustrate my point, I can say that I have decided to drop Python as a tool language now that I have found .NET and C#: C# is almost as efficient to code in as Python, but the result runs hundreds of times faster than the corresponding Python script.  Believe me, I’ve rewritten all of my Python scripts to C#.  And I have been very happy that I did so too: In fact, I no longer have Python installed on my system, even though I’ve been a great advocate of Python for a decade.

If you’re still skeptical, try to download NutBox and play with it for a few hours.  You can’t tell they’re .NET applications, can you?  I can’t, and I am normally extremely sensitive to sluggish and slow programs.

This website is maintained by .  Copyleft (-) 2009-2012 Mikael Lyngvig.  No rights reserved.