Upload
asabi
View
41
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Dramatically increase performance for large amounts of data in Xaml GridView and ListView. Chipalo Street Program Manager II 3-158. Agenda. Panning Item virtualization Placeholder elements Incremental update Startup Presenter elements Customizing presenters. Panning . - PowerPoint PPT Presentation
Citation preview
Dramatically increase performance for large amounts of data in Xaml GridView and ListViewChipalo StreetProgram Manager II3-158
Panning• Item virtualization • Placeholder elements• Incremental update
Startup• Presenter elements• Customizing presenters
Agenda
Panning
Data template vs. item container template
Data template vs. item container template
Data template vs. item container template
Panning perf overview
Panning perf overview
Panning perf overview
Panning perf overview
Panning perf overview – UI virtualization
Panning perf overview – UI virtualization
Use ItemsStackPanel or ItemsWrapGrid to get item virtualization. The framework automatically does this for all apps that use the default ItemsPanel.
Item virtualization improvements
Panning perf overview
Panning perf overview
UI thread work
Panning perf overview
render item 21
Panning perf overview
render item 22
Panning perf overview
render item 23
<GridView ShowsScrollingPlaceholders="true“>
Placeholders increase perceived performance
All apps running on Windows 8.1 get placeholders for free.
Perf improvement from placeholders
Incrementally updating the data template
Incrementally updating the data template
UI thread work
Incrementally updating the data template
UI thread work
Incrementally updating the data template
phase 0
Incrementally updating the data template
phase 1
Incrementally updating the data template
phase 2
Incrementally updating the data template
UI thread work
Incrementally updating the data template
phase 0
Incrementally updating the data template
phase 1
Incrementally updating the data template
phase 2
Incrementally updating the data template
phase 2
Incrementally updating the data template
phase 3
ContainerContentChanging<GridView ContainerContentChanging=“YourCCCEventHandler“>
ContainerContentChanging args• Phase• RegisterUpdateCallback• Handled• ItemContainer• Item• InRecycleQueue• ItemIndex
Consider implementing incremental updating for scenarios when rendering items is expensive.
Using ContainerContentChanging to implement incremental updating
Startup
Data template vs. item container template
Data template vs. item container template
Data template vs. item container template
Win 8 item container templates are expensive
Win 8 item container templates are expensive
Win 8 item container templates are expensive
Win 8 item container templates are expensive
Many items exacerbate problem1050 objects created for state alone!
Item presenters
Windows 8 Windows 8.1
All apps that use default item container visuals start up to 26% faster when running on Windows 8.1
Use presenters in customized item container templates
<GridViewItemPresenterSelectionChecMarkVisualEnabled=“False”SelectionBackground=“#FFFF8c00”SeletionBorderThickness=“5” />
+ =
Use presenters in customized item container templates to get start up improvements on Windows 8.1
Migrating to GridViewItemPresenter
Default✘✘
Structural item container template customization
Customized
Build visual tree with GoToElementStateCore
Build visual tree with GoToElementStateCore
Build visual tree with GoToElementStateCore
Build visual tree with GoToElementStateCore
Build visual tree with GoToElementStateCore
Customization via GoToElementStateCore
Customization via Windows 8 template
Building a visual tree on demand of customized item container templates results in better startup performance and reduced memory overhead.
Review – Item virtualization
Default ItemsPanel Custom ItemsPanelWindows 8 Recompile app for
8.1Change to new panel
Windows 8.1 FREE! Change to new panel
Faster startup and faster item presentation
Review – Placeholders
Improves perceived performance
Free for all apps!
Review – Incremental updateIncrementally update all items instead of fully rendering a few
Windows 8 – N/A
Windows 8.1 – Use ContainerContentChanging
Default ItemContainerStyle
Custom ItemContainerStyle
Windows 8 Recompile app for 8.1
Change template to use presenters
Windows 8.1 FREE!
Change template to use presenters
Review – Presenters
✘
✔Improve startup by up to 26%
Review – GoToElementStateCoreImprove startup by up to 26%
Windows 8 – N/A
Windows 8.1 – Use GoToElementStateCore
ResourcesNotes in the slides!3-157 Xaml Performance Fundamentals3-403 App Performance: The Mental Model for Interacting with the Platform3-099 App Performance: From UX to API for 5 Key Scenarios2-100 App Performance: The Windows Performance Toolkit2-098 App Performance: Planning Costs Less Than Architectinghttp://aka.ms.fastxaml
Evaluate this session
Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.