How does .NET Micro Framework work? Is it fast?.NET Micro Framework is a very large set of libraries and a core CLR (interpreter).When you write an application in Visual Studio and run it, Visual Studio will transfer your code to the device and store it in a reserved region. This region of the chip is reserved for your managed application. Note that your application is only what you write, it doesn't include the NETMF libraries since they are already stored on the device via the firmware.Lets say you write a program to read XML files. Your program will be simple. The complex work is done in FAT file system and XML libraries. Those libraries are already included in the framework (in the firmware).Now, is it fast? Yes, it is fast depending on if you write your code right. It is a fact that managed code runs much slower than native code. Managed code runs checks at runtime, so for example when you access an array in C/C++, you can easily go over the array boundary undetected and overwrite some random memory. This is an extremely difficult bug to catch. Modern managed languages like C# check every time you access an array to see if you are within the boundaries or not. Such checks are great but they have their performance penalties. The managed application is also interpreted, which also runs slower than native code. So if you're making a function that encrypts data, it will run too slow. Why? Because all the encryption code is interpreted. This is why NETMF includes a large set of libraries to accomplish many things including cryptography, for our example. When you try to encrypt the data, you will simply be passing your data onto the internal code which is not interpreted and it runs very fast.Someone can comment and say, I can toggle a pin faster on an 8bit micro than I can on NETMF devices! This is correct, but what kind of project only toggles a pin? Make a decently sized project and then compare speed. Try our example from earlier, read an XML file from a USB thumb drive and parse it. 8bit devices will probably not be capable of doing so and if they did it will be slower than NETMF. In short, use the built-in functions as much as you can and your project will run fast.
Guys, just trying to understand one thing. Is the Arduino code interpreted?