MIX11 – Session Review – Powering Data on the Web and Beyond with SQL Azure

David Robinson (Senior Lead Program Manager)

SQL Azure Relational Database

  • Based on SQL Server 2008 R2 engine
  • Use same tools and data access frameworks
  • Six global datacenters
  • High Availability & Redundancy
    • Reads are completed at the primary
    • Writes are replicated to a quorum of secondaries

SQL Azure Roadmap

  • MIX08
    • Introduced SQL Server Data Services (ACE type)
  • MIX09
    • Introduce SQL Data Services (Real Relational Database)
  • MIX10
    • New Features announced
      • 50 GB Database
      • PHP Support
      • MARS support
      • OData Endpoint Preview
      • Geo Spatial Data Types

ASP.NET MVC 3

  • Razor view Engine which provides a very streamlined syntax for writing clean and concise views.
  • Improved support for Dependency Injection
  • Global Action Filters
  • jQuery based Unobtrusive Ajax and Client Validation
  • ViewBag property for dynamic access to ViewData
  • Support for view engine selection in the New Project and Add View dialog

Extending the Reach of Data

  • This is achieved using ODATA protocol
  • Cloud Data Services
    • Windows Azure Tables
    • SQL Azure
    • Windows Azure MarketPlace DataMarket
  • Powering Web/AJAX Experiences
    • Consuming ODATA via jQuery & JSON
  • Powering Windows Phone 7
    • ODATA libraries available for Windows Phone 7
  • Powering Interoperability on Other platforms

Why does Performance matters?

  • More responsive applications
  • Faster page load times
    • 8 seconds vs 3 seconds
  • Higher interactivity – new type of applications
  • Better User Experience – more $$$$

SQL Azure Data Sync

  • Sync within the Cloud
  • Read scale-out via multiple copies
    • reporting
    • web site reference data
  • Read-write scale-out via multiple copies:
    • ex. geo located web apps
  • Same or different data centers
  • Key features
    • No-Code sync configuration
      • Easily define data to be synchronized and locations
      • Choose how often data is synchronized
    • Full Data Synchronization Capabilities
      • Two-way sync of same data, as well as one-way sync
    • Conflict Handling
      • Detect and resolve conflicts caused by the same data being changed in multiple locations
    • Logging and Monitoring
      • Administration capabilities for tracking usage
    • Scale
      • Service scales as resources requirements grow
  • Currently there are 2 CTPs available
    • CTP 1 publicly available
    • CTP 2 invitation only
    • CTP 3 will be available by the end of the summer and will be feature complete

Geo Available Applications

  • Windows Azure Traffic Manager
    • This will help handle geo-locating SQL Azure Databases
    • This will manage the traffic
  • SQL Azure Data Sync
    • Syncs the SQL Azure Databases between regions

CY11 Investment Themes

  • Managed Services
    • Data Protection / Recovery
      • Local Backup/Point in Time Restore: to recover from user/apps errors
      • Geo Backup/Disaster Recovery from data center/geographical disasters
    • New Data Movement Capabilities
      • DB Import/Export of data and schema between SQL Azure and SQL Server
      • Migration Support to SQL Azure from Sybase, in addition to existing support for Access, MySQL and Oracle
    • Enhanced Management Experiences
      • Enhanced portal based experiences
      • Multiple DB administrators per subscriptions to support enterprise scenarios
  • Scale on Demand
    • Scale-out with Federations
      • Scale to virtually unlimited size to host very large databases across multiple servers
      • Better support for multi-tenant applications with numerous tenants
    • Scale-up and Scale-down Databases
      • Scale beyond 50GB and less than 1GB
    • Performance Predictability
      • Reserve compute capacity with Resource SLA
    • Enhanced multi-tenancy support
      • API level support for multiple DB server per subscription, provisioning & de-provisioning
  • Faster Innovation
    • Rich Insights with Reporting as a Service
      • Ability to author rich reports, host in Azure and view in on-premise or cloud apps
    • Spanning Apps with Sync Service
      • Synchronize data between SQL Azure DBs between SQL Azure & SQL Server
    • Rich Developer Experiences
      • Professional Devs: VS “Juneau”
      • Department Devs: LightSwitch
      • Java Devs: supported JDBC driver
      • International Devs: Localized Azure Portal
    • Data Market Enhancements
      • International rollout
      • Enhanced Content Management
      • Integration with Denali, Office and CRM

Resources

MIX11 – Session Review – Windows Azure Storage -Getting Started and Best Practices

Haridas (Software Developer Lead)

  • Windows Azure Storage
    • What is it?
      • Scalable, Durable, Highly Available Cloud Storage System
      • Pay for what you use
      • Abstractions
        • Blobs – Provides a simple interface for storing named files along with metadata for the file
        • Drives – Provides durable NTFS volumes for Windows Azure Applications to use – based on Page Blobs
        • Tables – Provides structured storage. A Table is a set of entities which contains a set of properties
        • Queues – Provides reliable storage and delivery of messages for an Application
    • Data Storage Concepts
      • Based on the Account
        • Container for Blobs (Blob Storage)
          • https://<account>.blob.windows.net/<container>
        • Table for Entities (Table Storage)
          • https://<account>.table.windows.net/<table>
        • Queue for Messages (Queue Storage)
          • https://<account>.queue.windows.net/<queue>
    • Blobs
      • Provides a highly scalable, durable and available file system in the cloud
      • An account can create many containers
        • No limit on number of blobs in a container
        • Limit of 100TB per account
      • Associate metadata with Blobs
      • Upload / Download Blobs
        • Allows range reads
        • Conditional operations – If-Match, Id-Not-Modified-Since, …
        • Sharing – Public containers, Shared Access Signatures (SAS)
          • SAS – pre-authenticated url
      • Storage client uses by default a timeout of 90 seconds. This can be changed using the BlobRequestOptions class to set the timeout to be according to the type of blob you’re uploading
      • Types of Blobs
        • Block Blobs
          • Targeted at streaming workloads
          • Each Blob consists of a sequence of blocks
            • 2 phase commit: Blocks are uploaded and them separately committed
            • Efficient continuation and retry
            • Send multiple out of order blocks in parallel and decide the block order during commit
            • Random range reads possible
          • Size limit is 200GB per blob
          • What to do?
            1. File has variable sized blocks
            2. Upload blocks in Parallel using PutBlock
            3. Retry failed blocks
            4. Commit blob using PutBlockList
        • Page Blobs
          • Targeted at random write workloads
          • Each blob consist of an array of pages
          • Size limit 1TB per blob
          • Page
            • Each page range write is committed on PUT
            • Page is 512 byte in size
            • Write boundary aligned at multiple of 512 byte
            • Range reads possible
            • Pages that do not have data are zeroed out
          • How?
            1. Write 5K bytes – PutPage
            2. Clear starting at a particular offset – ClearPage
            3. Overwrite bytes – PutPage
            4. Truncate Blob – SetMaxBlobSize
      • Sharing
        • Every blob request must be signed with the account owner’s key
        • Share your files options
          • The container must be public – read-only rights whenever you make a container public
          • Shared Access Signatures (SAS) – share pre-authenticated URLs with users
            • You decided who you’d like to share it with
            • You can give variable permition
              • Delete Blob
              • Write Blob
              • Read or Listing Blob
            • Two ways to do that
              • Everything embedded using the URL and doing that signing it with your owner key
              • Create an access policy that will contain all the parameters that normally are in the url
                • Advantage is that this will make it possible to change the policy after giving the URL so someone.
        • SAS
          • Use container level access as it allows access to be easily revoked
      • Snapshots
        • Point in time read-only copy of blob
        • Every snapshot creates a new read only point in time copy
        • Charged only for unique blocks or pages (ex. reuse blocks or pages)
          • For reuse, use WritePages or PutBlock & PutBlock
        • Restore snapshots using copy blob
        • Remember to cleanup your snapshots
      • Best Practices
        • Use parallel blocks upload count to reduce latency when uploading photo
        • Client Library uses a default of 90 seconds timeout – use size based timeout
        • Snapshots – For block or page reuse, issue block and page uploads in place of UploadXXX methods in Storage Client
        • Shared Access Signatures
          • Use container level policy as it allows revoking permissions
          • Share SAS Url using Https
        • Create new container for blobs like log files that have retention period
          • Delete logs after 1 month – create new containers every month
        • Container recreation
          • Garbage Collection can take time until which time container with same name cannot be created (this might make that you cannot create a new container immediately with exactly the same name after deleting the previous one)
          • Use unique names for containers
    • Drive
      • Provides a durable NTFS volume for Windows Azure Applications
        • Use existing NTFS APIs
        • Easy migration path to the cloud
        • Durability and survival of data on application failover or hardware failure
          • All flushed and un-buffered writes to drive are made durable
      • A Windows Azure Drive is a Page Blob
        • Mounts Page Blob as an NTFS drive
        • Mounted by one VM at a time for read/write
        • A VM can dynamically mount up to 16 drives
        • Drives can be up to 1TB
    • Tables
      • Provides Structured Storage
        • Massively Scalable and Durable Tables
          • Billions of entities (rows) and TBs of data
          • A storage account can contain many tables
          • No limit on number of entities (aka rows) in each table
          • Provides flexible schema
        • Familiar and Easy to use API
          • WCF Data Services – .NET classes and LINQ
          • REST (OData Protocol) – with any platform and language
      • Best Practices
        • Use the context.SaveChangesWithRetries(SaveChangesOptions.Batch)
          • SaveChangesOptions.Batch gives you transactional semantics to the operation
          • Transactions on entities are only allowed if the partition key is the same
        • CloudTableQuery<> handles ContinuationToken
        • Use clustered index in queries for performance (PartitionKey)
        • Limit large scans and expect continuation tokens for queries that scan
          • Split “OR” on keys as individual queries
        • Entity Group Transactions – Batch to reduce costs and get transaction
        • Do not reuse DataServiceContext across multiple logical operations
        • Discard DataServiceContext on failures
        • AddObject/AttachTo can Throw exceptions if entity is already being tracked
        • Point query throws an exception if resource does not exist. Use IgnoreResourceNotFoundException property
    • Queue
      • Queue are highly scalable, available and provide reliable message delivery
        • Simple, asynchronous work dispatch
        • A storage account can create any number of queues
        • 8K message size limit and default expiry of 7 days
        • Programming semantics ensures that a message can be processed at least once
          1. Get message to make the message invisible
          2. Delete message to remove the message
      • Access is provided via REST
      • Best Practices
        • Make message processing idempotent
        • Do not rely on order – invisibility time can result in out of order
        • Messages > 8K => use blobs or tables to store and message contains the blob or table entity key
        • Use message count to dynamically increase/decrease workers. Example:
          • Retain one instance that polls once every X time period
          • One instance polling every second result in 2.678.400 calls which cost around $2.67
          • Spawn more instances when you detect backlog
        • Use dequeue count to detect
          • Visibility expiry time needs to increase
          • Poison messages
  • Partitioning & Scalability
    • Know the scalability Targets
      • Single Blob Partition
        • Throughput up to 60 MB/s
      • Single Queue/Table Partition
        • up to 500 transactions (entities or messages) per second
      • Storage account
        • SLA – 99,9% availability
        • Capacity – Up to 100 TBs
        • Transactions – Up to 5000 entities per second
        • Bandwidth – Up to 3 gigabits per second
      • Scale above the limits
        • Partition between multiple storage accounts and partitions
        • When limit is hit, app may see ‘503 server busy’. Apps should implement exponential back-off
    • Storage Partition – How to Scale?
      • Every data object has a partition key
        • Different for each data type (blobs, tables, queues)
      • Partition Key is unit of scale
        • A partition can be served by a single server
        • System load balances partitions based on traffic
        • Controls entity locality
      • Systems load balances
        • Load balancing can take a few minutes to kick in
        • Can take a couple of seconds for partition to be available on a different server
      • Server busy
        • Use exponential back-off on “Server Busy”
        • Our system load balances to meet your traffic needs
        • Single partition limits have been reached
    • Automatic Load Balancing
      • Assignment
        • Process:
          1. When a request is made the Load Balancer delivers it to one of the Front-Ends and it’s delivered to the appropriate Back-Ends that is serving that partition
            • Each server has multiple partitions and the loads can be different
          2. If the Master System recognizes that a single service has to many request, then it will offload those partitions and reassign then to the systems that have less load
    • Partition Keys in each abstraction
      • Blobs
        • “Container Name + Blob Name” is the partition key
        • Every blob and its snapshot are in a single partition
      • Tables
        • “Table Name” + Partition Key is the partition
        • Entities with same partition key value are served from the same partition
      • Queues
        • Queue Name is the Partition Key
        • All messages for a single queue belong to the same partition

 

  • Interesting Tools to understand what’s happening with the Storage
    • Fiddler
    • Wireshark
    • NetMon

 

MIX11 – Session Review – What’s New in the Windows Azure Platform

James Conard (Sr. Director – @jamescon)

What is the Windows Azure Platform?

  • Provide the best and most comprehensive Platform as a Service offering for building, deploying, and running cloud applications
  • Open & Flexible
    • Using several technologies and not only the .NET Framework
  • Leverage Existing Investments
    • Use the known technologies and ways to develop that exist already in the market in order to reduce the difficulty of entering in the cloud
  • Ready for next Generation apps
    • Prepare for the next types of apps like mobile, and high available

Windows Azure Core Services

  • Compute
    • Scalable environment for running code
    • Enables .NET, C++, PHP, Ruby, Python
      • By default .NET Framework is installed but you can deploy the technology you’d like and use it
    • Automate Service Management
      • Abstract you from managing the infrastructure where your apps is running on
  • Storage
    • Scalable and highly available cloud storage
    • Blobs, Tables, Queues, Drives
    • REST APIs and several client libraries
  • Database
    • SQL Relational Database (SQL Azure)
      • Use the same knowledge that exist in using SQL Server and make them available in the cloud
    • Familiar programming model & Tools

Windows Azure Platform Roadmap

  • October 2008
    • Announced the Windows Azure Platform
    • First CTP of Windows Azure Platform
  • March 2009
    • Announced SQL Azure Relational DB
  • November 2009
    • Updates Windows Azure CTP
    • Announced VMRole, Project Sydney and Windows Azure Platform pricing and SLAs
    • Enable FullTrust & PHP, Java etc.
    • Project Dallas CTP
  • February 2010
    • Windows Azure Platform generally available
  • June 2010
    • Windows Azure Update
      • .NET Framework 4
      • OS versioning
    • SQL Azure Update
      • 50 GB databases
      • Spatial data Support
      • DAC support
  • November 2010 – Big Release
    • New Windows Azure Platform Management Portal
    • Multiple Service Administrators (co-Admins)
    • Remote Desktop
    • Full IIS
      • Web Roles previously using Hosted Web Core
        • Only supported a single HTTP or HTTPs endpoing
      • Web Roles now supporting Full IIS 7.0/7.5
      • Enables new scenarios
        • Multiple IIS websites
        • Multiple virtual machines
        • Configure IIS extensions
        • Web Deploy for Rapid development
    • Windows Server 2008 R2 & IIS 7.5
    • Elevated Privileges
    • Windows Azure Connect (CTP)
    • Windows Azure Virtual Machine Role (Beta)
    • Extra Small Instances
    • Startup Tasks & Admin Mode
      • Enables short, unattended setups on role startup
      • Silent MSIs, COM components, Registry Keys, Configuring Windows Server Roles, etc
      • Configuration Sample for startup tasks in the ServiceConfiguration.cscfg
        • <WebRole name=”test”>
          • <Startup>
            • <Task commandline=”<commandToBeRunned>” executingContext=”limited|elevated” taskType=”simple|foreground|background”/>
          • </Startup>
        • </WebRole>

Windows Azure Content Delivery Network (CDN)

  • Enabled from Windows Azure Platform Portal
  • Integrated with Storage (Blob Storage)
  • Recent Enhancements
    • Delivery from Windows Azure Compute instances
    • Https support
  • CTP of Smooth Streaming – End of April 2011

Windows Azure AppFabric Access Control Service v 2.0 (ACS)

  • Provides AuthN support using multiple identity providers
    • Easily integrate Live ID, Facebook, Yahoo, Google and Active Directory
    • Support for WS-Federation, WS-Trust, OpenID 2.0, OAuth 2.0
  • Familiar & Consistent .NET Programming Model
    • Use existing Windows Identity Foundations SDK & Assemblies
  • REST-based Service Management API
    • Integrate into your existing apps and control panels
  • Now Available
    • No charge during promotion period ending January 1st, 2012
    • Low cost after the promotion: $1.99 per 100.000 transactions

Windows Azure AppFabric Caching

  • Distributed in-memory cache for Windows Azure apps
    • Integrated directly with the cache using .NET client library
    • Session State Provider for Windows Azure applications
  • Caching provided as a building block service
    1. Configure an AppFabric Namespace
    2. Choose your cache size
    3. Write code against that service
  • Familiar & Consistent APIs
    • Same APIs as Windows Service AppFabric
  • Available commercially by the end of April
  • In the CTP only the Data Center of South Central US has the Caching Service
    • supported cache sizes: 128 MB, 256MB
  • After the end of April (commercial Availability) you’ll have it available in every data center with supported cache sizes from 128MB to 4GB

Cloud Data Services

  • SQL Azure Reporting (Currently in a Private CTP)
    • SQL Server Reporting provided as a Service
    • Reports authored using existing tools (BIDS) and deployed to SQL Azure Reporting
  • SQL Azure Data Sync
    • Data synchronization provided as a Service
    • Sync to/from SQL Azure Database
    • Sync between SQL Server and SQL Azure
  • Windows Azure DataMarket
    • Information marketplace for ISVs and IWs that provide trusted public domain & premium commercial data
    • Now commercially available
    • Firstly announced as codename “Dallas”

Performance Matters

  • The new Windows Azure Traffic Manager solved this problem
  • Load Balancing across multiple Hosted Services
  • Now Available in CTP
  • Three scenarios that are currently in the CTP
    • Performance
      • Directs the user to the best / closest deployment
    • Fault Tolerance
      • Redirect Traffic to another deployment based on availability
    • Round Robin
      • Traffic routed to deployments based on a fixed ration
  • Also allow to keep a status of all your apps in order to understand how to rout the traffic

Windows Azure Platform Access

  • Windows Azure Pass
    • Free 30-Day access to the platform
    • Includes:
      • Compute: 3 small instances
      • Storage: 3 GB + 250K transactions
      • Data Transfer: 3GB in & 3GB out
      • Database: 2x1GB Web Edition
    • Signup: http://windowsazurepass.com
    • Enter code: MIXABC
  • Introductory Trial
    • Available through September 30th, 2011
    • Includes:
      • Compute: 750 extra small hours + 25 small
      • Storage: 20GB + 50K transactions
      • Data Transfer: 20GB in & 20 GB out
      • Database: 1 GB Web Edition (90 Days)
    • Sign-up: http://windowsazure.com
    • Note: Requires Credit Card Information but allows you to access CTP services
  • Ultimate
    • Compute: 1.500 hours of small instances
    • Storage: 30 GB
    • Transactions: 2M
    • Bandwidth: 35 GB in / 35 GB out
    • Databases: 5 GB Web Edition
  • Premium
    • Compute: 1.500 hours of extra-small instances
    • Storage: 25 GB
    • Transactions: 1M
    • Bandwidth: 30 GB in / 30 GB out
    • Databases: 1 GB Web Edition
  • Professional
    • Compute: 750 hours of extra-small instances
    • Storage: 20 GB
    • Transactions: 250K
    • Bandwidth: 25 GB in / 25 GB out
    • Databases: 1 GB Web Edition

Resources

Interesting topics

  • You can select which OSFamily you want to use by editing the ServiceConfiguration.cscfg file with the values:
    • 1 – Windows Server 2008
    • 2 – Windows Server 2008 R2
  • Currently ASP.NET MVC 3 isn’t available on Windows Azure and so you need to install it using a Startup Task
  • Release of some Extensions for ACS 2.0 that allow ACS to be plugged directly in Umbraco allowing it to configured without going to the Management Portal

MIX11 – Session Review – HTML5 for Silverlight Developers

Giorgio Sardo (Senior Technical Evangelist)

What is HTML5?

  • Currently Working Draft
  • Microsoft believes that HTML5 is ready to go “Last Call” (Feature Complete) and early May 2011
    • This isn’t everything that has been talked about as being HTML5 since several different specs related to HTML5 are being worked on and in different stages

Developer Web Platform

  • Silverlight
    • XAML
    • Managed Languages
    • .NET APIs
  • Browser
    • HTML
    • SVG
    • CSS
    • Javascript
    • Web Apps
    • Note: For Microsoft, Silverlight shouldn’t compete with HTML5, but really being an extension for HTML5, since it does things that are currently not possible in HTML6.
  • Client Side Frameworks
    • jQuery
    • Modernizr
    • RxJs

Comparing some elements between HTML5 and Silverlight

    HTML5

    Silverlight

    Doctype App Manifest
    SVG XAML Graphics
    SVG Styles Resource Dictionaries
    Canvas Canvas/WritableBitmap
    Audio & Video Audio & Video
    CSS3 Grid, Flexbox Layout Controls
    CSS3 WOFF Typography
    CSS3 Transforms Transforms
    DOM OO and Event Model
    Timer DispatcherTimer
    Ecma Script 5 Managed Languages
    XDomainRequest Crossdomainpolicy.xml
    Web Storage Isolated Storage
    windowPerformance Profiling

Tools

  • Visual Studio 2010 SP1
  • Microsoft Expression
    • Microsoft Expression Design
    • Microsoft Expression Web
    • Microsoft Expression Encoder
    • Microsoft Expression Super Preview
  • AI->Canvas
  • AI
  • Inkscape

 

HTML5 DOC Type

  • Similar purpose to the AppManifest in Silveright

SVG

  • SVG Stands for Scalable Vector Graphics, an XML grammar for stylable grafics, usable as an XML namespace
  • Hosted as inline HTML, image, frame
  • Similar to XAML

SVG Graphics

  • Shapes: ‘path’, ‘rect’, ‘circle’, ‘ellipse’, ‘line’, ‘polyline’ and ‘polygon’
  • Text
  • Solid Colors, Linear and Radial Gradients, Pattterns
  • Raster Images
  • As in XAML you can use ViewBox

SVG Resources

  • ‘defs’ – defines the resources / ‘use’ – uses the resource
    • in XAML you can apply resource to just one scope and in SVG defs are accessible to all, like a Page Resource in XAML
  • ‘g’ – groups ‘defs’
  • CSS styling
    • you can use CSS rules to style SVG
  • Everything you draw in SVG as action and events
  • It doesn’t exist any Visual State Manager

HTML5 <Canvas>

  • HTML5 <canvas> != Silverlight canvas
  • Gives your Pixel Manipulation
  • the content of the <canvas> is the fallback that will appear in case of the browser no supporting that element

HTML5 <audio> & <video>

  • Suggested codec: MPEG-4 (H.264), MP3
  • Composite with HTML content
  • Not supported
    • Full screen
    • Smooth Streaming
    • DRM

CSS3 Layout

  • Silverlight Border = CSS3 Border
  • Silverlight Canvas = absolute positioning
  • Silverlight Grid = CSS3 Grid (submitted by Microsoft to W3C)
  • Silverlight Stackpanel: CSS3 Flexbox
  • Silverlight ViewBox: SVG ViewBox

CSS3 WOFF

  • Typography
  • @font-face (submitted by Microsoft and Mozilla to W3C)

Javascript and DOM

  • “Classic” Javascript
  • APIs exposed by the DOM:
    • DOM core
    • DOM Events
    • DOM HTML
    • DOM Style
    • … (around 20)
  • ECMA Script 5 simplifies the development
  • Frameworks
    • jQuery, …

Animations

  • setTimer() and setInterval() are your best friend
  • Be carefull since in Web you have only 1 thread

Cross Domain Requests

  • In Silverlight we have the crossdomainpolicy.xml
  • In HTML5 it uses Headers (origin) using XDomainAddress

HTML5 Web Storage

  • Similar to Silverlight Isolated Storage
  • Local or Session Storage
  • Based on Key/Value pairs
  • Limit 5MB per domain
  • Currently you can’t increase the limit

Profiling

  • windows.Performance.timing.ToJSON() – Proposed by Microsoft and currently a standard

Frameworks

  • jQuery
  • Modernizr
  • Raphael
  • RxJs
  • Script#
  • MVVM for JS (????)

More to come …

  • Network: HTML5 Web Sockets
  • Database: HTML5 IndexedDB
  • Devices: HTML5 Media Capture APIs

Resources

MIX11 – Session Review – Silverlight Performance Tips

Michael Cook ( Developer on Silverlight Performance )

  • Ideology
    • Develop a performance culture in your group
      • Test throughout your product cycle
      • Automate your performance Tests
      • Use your customer’s target hardware
    • Performance is a feature, treat it like one!
      • Spec
      • Schedule
      • Sign-off
  • Profiling with Visual Studio 2010
    • Sampled profiling (Available for Silverlight in the SP1 of VS2010)
      • Collects statistics about program execution
        • Identifies execution bottlenecks
        • Low overhead
      • Available on VS2010 Premium and Professional
      • If you don’t have it just use the WIndows Performance Toolkit (XPerf) – Free
  • Using the “EnableRedrawRegions” flag
    • How?
      • SilverlightHost host= Application.Current.Host;
      • host.Settings.EnableRedrawRegions = true;
  • Analyzing memory usage
    • What is memory profiling?
      • Analysis of the working set of an application
      • Careful, the terminology is confusing
        • VMMap.chm is a good authority for defining memory related terms
    • What is working set?
      • represents the amount of committed virtual memory that is physical memory and owned by the process
      • Most developers only look at “private”
    • Getting Started
      • VMMap
        • Great tool for getting 30.000 ft view of what’s going on in your app memory footprint
    • Managed Memory
      • WinDbg + Son of Strike (SOS) extension
        • Debugger extension for WinDbg
        • Allow you to inspect the live managed heap in an application
      • Some commands for quick reference
        • !loadby sos coreclr
        • !dumpheap –stat
        • !dumpheap –type <typename>
        • !dumpheap –mt <metertag>
        • !gcroot <address>
        • !do <address>
      • Third-party Memory Profilers are also interesting
    • Native Memory
      • XPerf native heap analysis
        • HeapMonitor.cmd makes it easier (Silverlight Performance Blog)
        • HeapMonitor.cmd –p %pid%
  • General Tips & Tricks
    • Improve Startup
      • The cardinal rule
        • Do the absolute minimum required to display your main screen
      • Methods
        • Simplify your XAML
        • Load less data and/or load data asynchronously
        • Reduce your XAP download size
          • Time Heuer’s “Loading Dynamic XAPs and Assemblies”
        • Use a splash screen if needed
    • Improve runtime performance
      • Reduce the complexity of the visual tree
      • Update only what is necessary on the screen
        • Use “EnableRedrawRegions”
      • Avoid updating elements with effects applied (eg. Shader Effects)
      • Leverage GPU acceleration and cached composition
      • Use BackgroundWorker for long running operations

References