1 / 45

Compact Framework Performance Tips, Tricks And Best Practices

Agenda. General Principles.NET Compact Framework OverviewPerformance in the .NET Compact FrameworkCommon Language RuntimeBase Class LibraryFrameworkMeasuring PerformanceSummary. General Principles Golden Rules Of Performance. Make performance a functional requirementSet performance goals a

duard
Download Presentation

Compact Framework Performance Tips, Tricks And Best Practices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. .NET Compact Framework Performance Tips, Tricks And Best Practices Jonathan Wells jonwells@microsoft.com blogs.msdn.com/onoj Product Manager Smart Client / Mobility Microsoft Corporation

    2. Agenda General Principles .NET Compact Framework Overview Performance in the .NET Compact Framework Common Language Runtime Base Class Library Framework Measuring Performance Summary

    3. General Principles Golden Rules Of Performance Make performance a functional requirement Set performance goals as early as possible Revise performance goals at each milestone Design, code and test for performance throughout application development life-cycle

    4. General Principles In General… Less code is faster code Fewer objects are better for performance Recycle and re-use expensive resources Batch work where possible Initialize lazily Do work in the background to affect “perceived” performance Use threads and asynchronous calls Understand what the APIs are doing

    5. Agenda General Principles .NET Compact Framework Overview Performance in the .NET Compact Framework Common Language Runtime Base Class Library Framework Measuring Performance Summary

    6. .NET Compact Framework Design Overview Portable and small .NET common language runtime (clr) for devices Peacefully co-exist with host OS Correctness, reliability, performance Differences from the full .NET Framework 1.0 / 1.1 Size and scalability No install time JIT (NGEN)

    7. .NET Compact Framework Performance Roadmap 1.0 (Feb 2003) 1.0 Service Pack 1 (August 2003) GUI Tuned ARM code cache working set Available on Smart Phone 1.0 Service Pack 2 (December 2003) XmlTextReader ADO .Net Resource manager 1.0 Service Pack 3 (currently in beta) --- .NET Compact Framework 2.0 – (H12005) Framework, base class libraries and etc XMLTextReader and Data classes were what we focused onXMLTextReader and Data classes were what we focused on

    8. Agenda General Principles .NET Compact Framework Overview Performance in the .NET Compact Framework Common Language Runtime Base Class Library Framework Measuring Performance Summary

    9. Common Language Runtime Execution Engine JIT compilers Two JIT compiler architectures today Emulator and ARM device performance experience may be different Optimizations (ARM) Method inlining for simple methods Optimizations are unavailable while debugging from Microsoft Visual StudioŽ Some optimizations are unavailable when assemblies are compiled as ‘debug’ Call path Properties are calls Virtual calls are more expensive Platform Invokes are more expensive Device Issues Floating Point Pocket PC and Smartphone platforms don’t have FPUs Other hardware latency in RAM, I/O, System Buses, Video, SD cards

    10. Common Language Runtime Sample Code: Properties Versus Methods class PerformanceTest { int x; public int Method1() { return x; } public int Property1 { get { return x; } } public int Method2() { try { return x; } catch {} } public int Property2 { get { try { return x; } catch{} } } }

More Related