Why are my programs running from my SD card so slow?
When moving my .Net Compact Framework application to the SD-card of a Windows CE device, the program executes slower then running it from the internal memory.
I thought, the start-up might be slower, but it is the whole program. There is no IO to the storage card.
Why is my application so slow and how does the compact framework handles and loads the assemblies?
It has to do with demand-paging. Your app cannot be run directly from the SD-card, as SD is not executable media so it has to be pulled into RAM to run. Windows CE doesn't typically have a whole lot of RAM, so the loader doesn't pull your entire application into RAM to run. Sure, your heaps and stacks will be in RAM, but the actual IL code in the assembly itself is paged in as needed. It's also paged out when the system decides it no longer needs a specific page.
This paging can have an impact on performance, though I'm a bit surprised that it's a large impact unless the app itself is really large (like if you have lots of embedded resources that it's pulling out of the assembly).