.NET Compact Framework Performance Strategies MBL 402 Ivo Salmre Product Manager.NET Developer Technologies, UK Microsoft Corporation.

Slides:



Advertisements
Similar presentations
Android architecture overview
Advertisements

DEV351 ADO.NET Performance Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
WEB401 Security Practices for Web Services (Part 2) Keith Ballinger Program Manager XML Messaging Microsoft Corporation.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
SQL Server 2005 CLR Integration ADO.NET 2.0 Mike Taulty
OFC324 Microsoft Project Server: Putting Enterprise Project Management (EPM) To Work Sam Brooks
CH 13 Server and Network Monitoring. Hands-On Microsoft Windows Server Objectives Understand the importance of server monitoring Monitor server.
Windows Server 2008 Chapter 11 Last Update
Connecting Runtime-Free to Any OPC-DA Server with VS.NET Your Host Today: Win Worrall Application Engineer and Developer Got a snazzy graphic mike – remove.
Punit Shah Technical Lead | Microsoft
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
OFC 322 Building Office Research Web Services: Exposing Corporate Data Through Office Brian Jones Program Manager Authoring Services Martin Sawicki Lead.
DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information.
MCTS Guide to Microsoft Windows 7
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Visual Studio ®.NET Data with XML Carlotta Eaton ( Associate Professor of IST New River Community College Slides by Microsoft Modified.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
OFC 200 Microsoft Solution Accelerator for Intranets Scott Fynn Microsoft Consulting Services National Practices.
DEV290 Building Office Solutions with Visual Studio Eric Carter Lead Developer Developer Platform & Evangelism Microsoft Corporation.
DAT336 Connected vs Disconnected Data Access in ADO.NET Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
SEC303 Assessing and Managing Privacy in the Enterprise JC Cannon Privacy Strategist.
DEV402 Extending the ASP.NET Runtime Jurgen Postelmans Microsoft Regional Director BeLux U2U.
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
Introduction to the Compact Framework Marcus Perryman Principal Consultant Microsoft.
OFC 307 Office 2003 Solution Case Studies Ray Stephenson Smart Client Technical Evangelist
DEV337 Modeling Distributed Enterprise Applications Using UML in Visual Studio.NET David Keogh Program Manager Visual Studio Enterprise Tools.
Paul Butterworth Management Technology Architect
DEV384 COM+ Lives : New Features in Enterprise Services Included in Windows Server 2003 Catherine Heller Senior Consultant Microsoft Spain.
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
DEV333 Instrumenting Applications for Manageability with the Enterprise Instrumentation Framework David Keogh Program Manager Visual Studio Enterprise.
Rob Tiffany Mobility Architect Microsoft Corporation MOB401.
How to Build Scalable & Secure Database Applications Noel Jerke & Erin Welker Scalability Experts.
MBL401.Net Compact Framework: Data Access Best Practices Paul Foster Mobile solutions architect.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
CH 13 Server and Network Monitoring. Hands-On Microsoft Windows Server Objectives Understand the importance of server monitoring Monitor server.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
MBL490 Deploying Applications to Smartphone and Microsoft® Powered Pocket PC Marcus Perryman Consultant.
DAT300 SQL Server Notification Services: Application Development Ken Henderson Technical Lead, SQL Server Support Microsoft Corporation
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
Tips & Tricks: Writing Performant Managed Code Rico Mariani FUNL04 Performance Architect Microsoft Corporation.
DEV394 Windows Forms Performance Tips And Tricks Mike Henderlight Development Manager.NET Client Team Microsoft Corporation
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
DEV332 Programming for the Middle Tier in Visual Basic.NET Billy Hollis Author / Consultant.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
IE Developer Tools Jonathan Seitel Program Manager.
DAT200 Microsoft® ADO.NET for ADO Classic Developers: Introducing ADO.NET Jackie Goldstein Renaissance Computer Systems
DEV414 Black-belt ASP.NET Tips And Tricks For Your ASP.NET Applications Rob Howard Program Manager Web Platform and Tools Team.
MSG 334 Creating Exchange Administrative Scripting for the Non-Programmer Susan Hill Lead Programmer Writer Microsoft Corporation.
OFC311 Developing Microsoft Office InfoPath 2003 Solutions: Technical Drilldown Part 1 Tudor Toma Group Program Manager Office Microsoft Corporation.
Architecting Real-World Enterprise Application. Agenda CPR - Background Challenges in the Architecture Architecture Details Q & A Summary.
Advanced Managed Code Development Features Marcus Perryman
Top 10 Entity Framework Features Every Developer Should Know
Introducing the Microsoft® .NET Framework
6/2/2018 4:08 AM BRK3327 Ten things you didn't know about building .NET UWP apps in Visual Studio 2017 Daniel Jacobson Program Manager – Visual Studio.
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Spark Presentation.
Visual Studio Tools for Office 2005
Enterprise Library Overview
The Application Lifecycle
Entity Framework Core.
Introduction to .NET By : Mr. V. D. Panchal Content :
Mark Quirk Head of Technology Developer & Platform Group
Getting Data Where and When You Want it with SQL Server 2005
Presentation transcript:

.NET Compact Framework Performance Strategies MBL 402 Ivo Salmre Product Manager.NET Developer Technologies, UK Microsoft Corporation

Agenda Introduction.NET Compact Framework performance characteristics Process for maximizing application performance Tips and tricks Summary

Agenda Introduction.NET Compact Framework performance characteristics Process for maximizing application performance Tips and tricks Summary

What Is Performance? Affected by two principles Absolute Performance of the system; the raw processing horsepower Apparent Performance of the application; affected by how the application is written Application performance is qualitatively measured by how responsive the application is to the end user

Key Considerations Keep target hardware in mind Think constrained, think mobile Use only what you really need Where is performance important? Start-up? Data Access? What is causing the slow down? Does the user need to know the slow down exists?

Agenda Introduction.NET Compact Framework performance characteristics Process for maximizing application performance Tips and tricks Summary

Performance Overview High performing execution engine Graphics and user interface performance Data and XML performance

How we’re doing… TestTech Preview Today Rectangles/sec70749 Ellipses/sec Pixel Segs/sec Windows/sec XMLRead/564K161 sec18 sec RemoteMethod16 sec1 sec *Performance numbers taken using a 204 MHz, Strong ARM Powered PocketPC device We’ve come a long way, baby!

Size Data AreaSize (KB) Execution Engine (Native Code and Binary Data)469 Base Classes350 WebSerices/XML130 Drawing/Forms190 Data (ADO.NET)175 Visual Basic.NET Run-Time Library56 TOTAL:1370 *Size numbers taken on Windows CE.NET device with a Strong ARM processor

The EE A short review Compiled managed code is a binary in Microsoft Intermediate Language Code is just-in-time compiled to the native processor language on type-by-type, method-by- method basis Resulting native code is cached for later reuse Over the lifetime of the app, the up front cost of jitting is amortized, and becomes less and less significant

Code Pitching Occurs when large volumes of allocated memory cause memory pressure Runtime will discard or pitch code from the code cache Qualitative inspection will tell you when this occurs

Behavior Under Memory Pressure Memory utilization Performance

User Interface Performance Version 1 performance is excellent! System.Drawing and System.Windows.Forms call to native APIs beneath Made more efficient by “batching” them where possible across the managed/native boundary Pools and reuses Window Handles

Data And XML Performance Version 1 performance is good Most of stack is implemented entirely in managed code Remember that absolute performance is affected by memory pressure

Agenda Introduction.NET Compact Framework performance characteristics Process for maximizing application performance Tips and tricks Summary

Use Methodical Process Analyze Performance of Application Discover where the application is slow Choose where to optimize What’s important to the customer scenarios? Understand what the APIs are doing Does the API do more than you need? Different scenarios call for different performance priorities

Understand The APIs How abstract is the API? Example: XmlDocument versus XmlTextReader/Writer What work has to happen under the hood? Be aware of how events fire Don’t do a lot of work in a click event if a user will be tapping and dragging object

Benchmarking Tips Isolate exactly what is being measured Keep microbenchmark test times > 10sec Repeat tests 3-5 times Ensure comparison of Apples to Apples Use real code when possible Test multiple designs and strategies Understand the differences or variation

Perf Stats Logged to a file on the device nObjectsAllocated, nCurrentObjectsAllocated Collect time is a function of current object count nSimple/Compact/FullCollections More compact  full collections under memory pressure msFullLatency Maximum app pause due to collection Determined by number of live objects cbJittedNative, nMethodsJitted How much native code is being generated? cbPitched, nMethodsPitched More code pitched under memory pressure Enabled via Registry Key

Alerts Client

Alerts Client Overview AlertsDB.xml DataSet Treeview Server Populates Populates Synced

Alerts Client Design strategies DataSet.ReadXML() 20 seconds total load time XMLTextReader – Forward Data Loading File Read Time 6 seconds (Total: 11 seconds) TreeView Load Time slow XMLTextReader + Delay TreeView Population File Read Time 2 seconds (Total: 3-4 seconds) TreeView Load Time faster SQL Server CE + Delay TreeView Population Query Time 3 seconds (Total: 3-4 seconds) TreeView Load Time faster (same as above)

Alerts Client Design strategies 1. DataSet.ReadXML() 20 seconds total load time 2. XMLTextReader – Forward Data Loading File Read Time 6 seconds (Total: 11 seconds) TreeView Load Time slow 3. XMLTextReader + Delay TreeView Population File Read Time 2 seconds (Total: 3-4 seconds) TreeView Load Time faster 4. SQL CE + Delay TreeView Population Query Time three seconds (Total: 3-4 seconds) TreeView Load Time faster (same as above)

Alerts Client Lessons learned Methodical process, iterate on multiple designs Be creative! Understanding APIs being used Think of the user scenario Here, no need for user to see sub nodes of Tree

Agenda Introduction.NET Compact Framework performance characteristics Process for maximizing application performance Tips and tricks Summary

Execution Engine Don’t call GC.Collect()! Minimize the number of function calls Consider making functions larger rather than having incredibly deep call stacks Make use of asynchronous calls where useful, but avoid creating too many threads Reduce, reuse, recycle! The less memory you allocate, the faster your app will be!

User Interface Reduce number of method calls Example use Control.Bounds instead of Control.Location + Control.Size Create the Window tree top down, rather than bottom up Opposite of what VS.NET does by default Minimize control addition on Form.Load() Defer loading of controls until they are used

Handling Data Defer data loading until it is required, discard when data no longer in use Minimize data in memory at any time Forward only reading is always faster than in memory representations XmlDocument versus XmlTextReader DataReader versus DataAdapter Use StringBuilder for complex string manipulations

Asynchronous Processing Always be on the look out for asynchronous processing Use built in asynchronous calls in network stack Create threads to do work that can be deferred, or that shouldn’t block user interface Network connections and data loading or synching are good candidates Update user interface using Control.Invoke() Let threads exit No Thread.Abort()

Asynch Network Requests WebService myWebService = new WebService(); IAsyncResult ar = BeginWebService(CallbackFunc, WebService); public static void CallbackFunc(IAsyncResult Result) { WebService myService = (WebService) Result.AsyncState; object[] RemoteObjects; RemoteObjects= myService.EndGetContactList(Result); }

Agenda Introduction.NET Compact Framework performance characteristics Process for maximizing application performance Tips and tricks Summary

Consider your user scenario Design, test and iterate on your design considering multiple approaches Methodically analyze performance of your application Understand APIs Reduce, reuse and recycle objects Minimize data in memory

Community Resources Most Valuable Professional (MVP) Newsgroups Converse online with Microsoft Newsgroups, including Worldwide User Groups Meet and learn with your peers

Suggested Reading And Resources The tools you need to put technology to work! TITLEAvailable Microsoft®.NET Compact Framework (Core Reference): Today Microsoft Press books are 20% off at the TechEd Bookstore Also buy any TWO Microsoft Press books and get a FREE T-Shirt

evaluations evaluations

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.