Download presentation
Presentation is loading. Please wait.
Published byΝικηφόρος Αλεξόπουλος Modified over 6 years ago
1
Tech Ed North America 2010 11/15/2018 4:14 AM Required Slide SESSION CODE: WCL306 Fundamentals in Windows Applications for Developers: Graphics, Power, Services, and Profiling Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation © 2010 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.
2
Microsoft Confidential
4
Improved Fundamentals in Windows 7
Decrease Increase Memory Reference set, Graphics Disk I/O Registry Reads, Indexer Power DVD Playback, Panel, Timers Speed Faster Boot, Device Ready Responsiveness Start menu, Taskbar Scale 256 cores
5
Building A Great Windows 7 Applications
Differentiate Create new experiences on Windows 7 EXPERIENCE Become a first class Windows 7 citizen Optimize Product passes Microsoft quality tests Compatible
6
Wednseday June 9th, Room 356, 8 am
Optimize for User Experience Get the Most Out of Windows New UI Enhancements Taskbar Jump lists Thumbnail Preview and Aero-peek Libraries and federated search Windows Ribbon DirectX, DirectWrite, and Direct2D More advance topics: Windows Touch Windows Sensors and Location WLC312 -Optimizing Your Application for the Windows 7 User Experience Wednseday June 9th, Room 356, 8 am
7
Optimize for Performance Get the Most Out of Windows Performance Enhancements
I/O priorities and cancelable I/O File System and Registry Transaction Support Windows Error Reporting Application restart and recovery with Restart Manager Power efficiency improvements Trigger-Start Services Windows Troubleshooting Platform Windows Instrumentation Windows Performance Tool Kit
8
Ensuring Good Performance
Responsiveness Unresponsive system customer dissatisfaction Resource Utilization CPU, disk, memory, network, Battery Resources are limited and shared by others Good Citizenship It takes just one component to impact the entire system performance
9
Power Efficiency
10
Power Efficiency “All day” mobile PC battery life
TCO – reduced cost of energy consumption New power consumption regulatory compliance Environmental consortiums for computing (Green Computing) Software performance is critical for Power Efficiency Windows 7 power optimization Less than 2% CPU activity when the system is idle No disk activity when the system is idle Reduced number of OS activities that prevent use of CPU’s power-saving modes.
11
Power Efficiency – Timer Coalescing API
Platform energy efficiency can be improved by extending idle periods New timer coalescing API enables callers to specify a tolerance for due time Enables the kernel to expire multiple timers at the same time BOOL WINAPI SetWaitableTimerEx( __in HANDLE hTimer, __in const LARGE_INTEGER *lpDueTime, __in LONG lPeriod, __in_opt PTIMERAPCROUTINE pfnCompletionRoutine, __in_opt LPVOID lpArgToCompletionRoutine, __in_opt PREASON_CONTEXT WakeContext, __in ULONG TolerableDelay ); Timer tick 15.6 ms Vista Periodic Timer Events Windows 7
12
Analyze Energy-Efficiency
Tech Ed North America 2010 11/15/2018 4:14 AM Analyze Energy-Efficiency DEMO © 2010 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.
13
Trigger Start Services
14
Impact of Background Activities Many activities in the background
Performance Responsiveness Consumes resources Boot, shutdown, logoff, and so on Reliability Memory leaks System crashes and hangs Dependent application crashes Security Greater attack surface System privileges Successful attack may compromise entire system Power consumption Extra disk, CPU utilization Decrease in battery life Prevents idle efficiencies
15
Do We Really Need So Many Services?
OEMs and third parties services Most services are not required during log-on Even more services are not required during boot Most services do not need to run 24x7 Conclusion: Most services can be launched on demand when needed Most services can be terminated on demand when needed Consider using Windows Tasks
16
Service Startup Types Prior to Windows 7
Automatic Start Your service is always there Launched as part of the boot sequence Slower startup time Bigger memory footprint Delayed Auto Start Just deals with Slow startup time Demand Start (manual) You must programmatically launch the service Why these services startup types are not enough? Automatic Start adds latency to boot and shutdown, and always consumes resources Demand Start is hard to program against and just resolve the startup problems
17
New In Windows 7 - Trigger Start Services
Trigger Start services are started when needed and stopped when their work is completed The service should be running only if it has something to do. Windows 7 Available service triggers: Device interface arrival Joining or leaving a domain Opening or closing a firewall port Group policy change First IP address arrival Last IP address removal Custom events (ETW)
18
Trigger Start API SERVICE_TRIGGER trigger = { 0 };
Tech Ed North America 2010 11/15/2018 4:14 AM Trigger Start API SERVICE_TRIGGER trigger = { 0 }; trigger.dwTriggerType = SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY; trigger.dwAction = SERVICE_TRIGGER_ACTION_SERVICE_START; trigger.pTriggerSubtype = (GUID*)&NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID; SERVICE_TRIGGER_INFO info = { 0 }; info.cTriggers = 1; info.pTriggers = &trigger; ChangeServiceConfig2(hService, SERVICE_CONFIG_TRIGGER_INFO, &info); © 2010 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.
19
Trigger Start Services In Windows 7
Tech Ed North America 2010 11/15/2018 4:14 AM Trigger Start Services In Windows 7 DEMO © 2010 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.
20
Troubleshooting Platform
21
Windows Troubleshooting Platform
Consistent troubleshooting experience Reduces helpdesk costs and drive higher user satisfaction Automates standard diagnoses, verify cycle Extensible–write your scripts and you’re good to go Based on Windows PowerShell™ scripts, can invoke any code Windows Troubleshooting Pack Designer (SDK) Easily integrated into your application Many troubleshooters available out of the box Leverage Windows troubleshooting for common issues
22
Windows Troubleshooting Platform In Action
Tech Ed North America 2010 11/15/2018 4:14 AM Windows Troubleshooting Platform In Action DEMO © 2010 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.
23
Troubleshooting Components
Troubleshooting Pack: Implemented in PowerShell V2 Uses a standard wizard interface Signed by a certificate Deployed as .cab files Can run remotely, can run unattended Troubleshooting Platform: Executes troubleshooting packs Generates reports for analysis
24
Troubleshooting Pack Anatomy
Identification Metadata Name and description List of configuration issues Security signature Detection Scripts Checks current configuration with expected configuration Trouble-shooting Pack Resolution Scripts Sets the current configuration to what is expected Verification Scripts Verifies that current configuration is now what is expected Localized Resources Contains localized display strings in MUI format
25
Component Interaction
Process 1 GUI CMD Troubleshooting Pack Windows Troubleshooting Framework Troubleshooting Runtime Engine Results and Reports Get-DiagInput Update-DiagReport Add-DiagRootCause Write-DiagProgress PowerShell Scripts Platform cmdlets Process 2 PowerShell Runtime
26
Windows Troubleshooting Platform In Action
Tech Ed North America 2010 11/15/2018 4:14 AM Windows Troubleshooting Platform In Action Built your own troubleshooting package DEMO © 2010 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.
27
Windows Instrumentation
28
Windows Instrumentation
Key Features High-performance, low overhead, highly scalable Native and Managed APIs Dynamic enablement of data collection Multiple data collection options Technology options (Windows Management Instrumentation) Performance Counters Event Log Event Tracing for Windows (ETW)
29
Windows Performance Counters
Always-present, always-on instrumentation infrastructure Numeric information grouped into categories, counters and instances Access Programmatically (native and managed) Through script languages Using the Performance Monitor tool (perfmon)
30
Exposing Performance Counters
Native Create a manifest Use the CTRPP preprocessing tool PerfAutoInitialize PerfCreateInstance PerfSet*Counter*Value Managed: System.Diagnostics namespace PerformanceCounterCategory class CounterCreationDataCollection class PerformanceCounter class
31
Windows Performance Counters
Tech Ed North America 2010 11/15/2018 4:14 AM Windows Performance Counters Exporting and viewing custom performance counters DEMO © 2010 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.
32
ETW/Event Log Event tracing for Windows
Always-present, selectively-on logging infrastructure Information defined by event templates Access Programmatically (native and managed) Script languages (PowerShell) Command Line tools (tracerpt) Event Viewer
33
Windows Event Overview
Event Audience Developer; IT Professional System Administrator Technology ETW Event Log Event Control Manual Always On Event Rate High (10^4 / sec) Medium (10^2 - 10^4 / sec) Features Declaratively defined in manifests Programmatic Consumption Discoverability Localizable Strings Flexible Data Model Same Features of ETW plus: Remote Collection Data Query Support Admin Focused Tools Centralized event logs Reduced logging rate
34
Xperf Scenarios Profile applications or the system itself (sampling profiler mode) Capture ETW data for later analysis Determine whether an application is I/O- or CPU-bound …and many others!
35
Windows Performance Toolkit
xperf.exe: Command-line tool for ETW capturing and processing xperfview.exe: Visual trace analysis tool xbootmgr.exe: On/off transition state capture tool Works on Windows Vista SP1, Windows Server 2008 and Windows 7
36
Capturing A Trace Turn tracing on: xperf -on <PROVIDER>
Perform activities Capture a log: xperf -d <LOG_FILE_NAME> Analyze it: xperf <LOG_FILE_NAME> xperf -on Base xperf -d result.etl xperfview result.etl
37
Xperf Disk utilization
38
Xperf Hard page faults
39
Xperf Overlay graph
40
Using Xperf to identify performance issues
Tech Ed North America 2010 11/15/2018 4:14 AM Using Xperf to identify performance issues Capture and analyze DEMO © 2010 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.
41
Optimize for Windows 7 Summary
Use Windows 7 features to optimize for performance I/O priorities and cancelable I/O File System and Registry Transaction Support Windows Error Reporting Application restart and recovery with Restart Manager Power efficiency improvements Trigger-Start Services Windows Troubleshooting Platform Windows Instrumentation Use Windows Performance Tool Kit to profile
43
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Tech Ed North America 2010 11/15/2018 4:14 AM Track Resources Learn about Windows Client Development: Try out the Internet Explorer 9 Platform Preview: Interested in Windows hardware or software? Check it out: © 2010 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.
44
Resources Learning Required Slide www.microsoft.com/teched
Tech Ed North America 2010 11/15/2018 4:14 AM Required Slide Resources Learning Sessions On-Demand & Community Microsoft Certification & Training Resources Resources for IT Professionals Resources for Developers © 2010 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.
45
Complete an evaluation on CommNet and enter to win!
Tech Ed North America 2010 11/15/2018 4:14 AM Required Slide Complete an evaluation on CommNet and enter to win! © 2010 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.
46
Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st
You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year
47
Tech Ed North America 2010 11/15/2018 4:14 AM
© 2010 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. © 2010 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.
48
Required Slide Tech Ed North America 2010 11/15/2018 4:14 AM
© 2010 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.