Download presentation
Presentation is loading. Please wait.
Published byRoberta Cobb Modified over 9 years ago
2
Kyle Marsh Principal Program Manager Microsoft Corporation WCL305
3
Agenda Background Activity Services Tasks Power Graphics Intuitive UI Windows Performance Toolkit
4
Fundamentals Increase Decrease
5
What Is Background Activity? System activity that is not directly initiated by user Services, Scheduled tasks, some COM processes such as a COM service, WMI providers, etc. Part of nearly every usage scenario: Search indexing System security and maintenance Network management Device management System configuration
6
Impact Of Background Activity Performance Responsiveness to the user Consumes resources from foreground applications Boot, Shutdown, Logoff, etc. Reliability Memory leaks System crashes, hangs Dependent application crashes Security Activity may require system privileges Successful attack may compromise entire system Power Consumption Extra disk, CPU utilization Decrease in battery life Prevents idle efficiencies
7
Background Activity Performance Impact Compared IT image to clean Windows Vista installation: 10 additional 3rd-party services
8
Windows 7 Trigger-Start Services Trigger-Start centralizes environmental detection logic SCM registers for system events via interesting providers: Device arrival IP address Domain join and leave Group policy updates Custom ETW (Event Tracing for Windows) events SCM starts or stops registered services
9
Some Trigger-Start Services In Windows 7 Service NameDescriptionTrigger Type AELookupSvc Processes application compatibility cache requests for applications as they are launched Custom ETW BDESVC Provides BitLocker client services for user interface and auto-unlocking of data volumes Custom ETW BTHSERV The Bluetooth service supports discovery and association of remote Bluetooth devices. Device SensorsMTPMonitor Monitors MTP (Media Transfer Protocol) sensors (such as a cell phone with a GPS receiver) to communicate sensor data to programs Device TabletInputService Enables Tablet PC pen and ink functionality Device WinDefend Protection against spyware and potentially unwanted software Group Policy
11
Consider Scheduled Tasks Task Triggers Task Conditions Calendar Boot Logon Idle Event log based entry Workstation lock Workstation unlock Idle condition Stop when not idle AC power only Stop on battery Wake computer from sleep Specific or any network connection
12
Scheduled Task Example Power Efficiency Diagnostics Windows 7 power problem analysis Executes every 2 weeks when the system is idle Requires SYSTEM privilege to access NT Kernel Logger Saves report data for user Uploads CEIP data to Microsoft Task Scheduler (schedule) Task Scheduler (schedule) Power Efficiency Diagnostics (powercfg.exe) Power Efficiency Diagnostics (powercfg.exe) Kernel Detects Idle Condition Launches Task
13
Performance and Power Performance is critical for background activity Adds to the base footprint of the system Interferes with foreground user activity Resource utilization directly tied to Power Consumption Target: Less than 2% CPU activity when the system is idle No disk activity when the system is idle Evaluate and Measure: Use XPerf (Windows Performance Tools Kit)
14
Battery Life Time Watts 0W - Off Idle Power Trade quality or performance for power savings Examples Index only high-priority items Disable animations DVD playback at 30fps instead of 60fps “Race to Sleep” Execute rapidly at high power Quickly re-enter low-power state Extend average idle duration Examples Timer coalescing Idle
15
Techniques Consume Less CPU Avoid polling at all costs! Poll no more often than once per second Use Timer Coalescing
16
Timer Coalescing API Specify a tolerance for expiration of the timer E.g., 1 second timer with 45 ms of tolerance Tolerance should be at least 16ms, preferably 33ms Period is not guaranteed Timer will always expire within Period +/- Tolerance from the previous expiration 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 ); DllImport("kernel32.dll")] static extern bool SetWaitableTimerEx( IntPtr hTimer, ref long lpDueTime, int lPeriod, TimerCompletionDelegate pfnCompletionRoutine, IntPtr lpArgToCompletionRoutine, IntPtr WakeContext, ulong TolerableDelay );
17
Energy Efficiency Best Practices Invest in performance optimizations Reduce disk and CPU usage when the system is on battery power Do not render to the display when it is off Avoid polling and spinning in tight loops Do not prevent the system from turning off the display or idling to sleep Respond to common power-management events such as system power source changes Avoid use of high-resolution periodic timers (< 10ms) as this reduces the efficiency of processor power- management technologies
18
Windows 7's Usage of the GPU Continues from Windows Vista… Media Center UI Video Playback Desktop Window Manager (DWM) Windows 7 DWM uses Direct3D10.1 API Scales in performance all the way from low end integrated to high end GPUs Shaders are used for blurs in the Glass Windows 7 memory consumption is cut by 50% per window More and richer animations of the thumbnails
19
Windows 7 DWM Memory Usage
20
Direct2D: New in Windows 7 Rendering Focused Immediate Mode API: 2D Vectors & Geometry, Bitmaps and Text Hardware and Software Pipelines Built for Performance on Direct3D 10.1 Interoperable with Direct3D and GDI High Quality Rendering: Per Primitive Anti-Aliasing and MSAA via Direct3D Remoted via Direct3D 10.1 Printing support via XPS
21
Direct2D Performance
22
DirectWrite: New in Windows 7 Modern typography Enables world-wide applications ClearType advances Works with any rendering technology Hardware accelerated via Direct2D
23
Gabriola
24
DirectWrite
25
Windows Performance Toolkit Enables analysis for a broad range of issues including: responsiveness issues long delays in applications resource utilization issues slow On/Off transitions poor battery life Wide support range cross platform: Vista, Server 2008, Windows 7 cross architecture: x86, x64, and ia64 Based on the Windows ETW Infrastructure enables extensions which use ETW instrumentation to leverage tool set intrinsic support for Windows kernel events also support for Windows Events Publicly available for download today Strategic ongoing investment to enable performance analysis on Windows
26
XPerf
27
Performance Best Practices General Use the Windows Performance Toolkit to measure system performance during all scenarios (steady state and on/off transitions) Optimize application resource consumption (CPU and Disk) in both active and Idle states Perform testing in a controlled way and make comparisons against a valid baseline Obtain a baseline measurement on a system with as few system extensions as possible Add devices, applications, and services one at a time and test for any performance regressions Boot Reduce application resource consumption post-boot Avoid using load order groups to express service dependencies Ensure that all services report as running as soon as possible during boot to avoid blocking the Service Control Manager (SCM) Ensure that all non-essential services are converted to Demand or Trigger start in order to free up system resources during boot Avoid using managed code for services and applications on the startup path
28
Performance Best Practices Sleep/Hibernate Avoid delays in processing the suspend notification (WM_POWERBROADCAST message) Verify that services do not opt in to receive suspend notifications unless absolutely required Ensure that all services respond quickly to resume events and minimize post resume CPU, disk and network usage Shutdown Ensure that all services do not opt in to receive preshutdown and shutdown notifications unless absolutely required Ensure that all services that have opted to receive shutdown notifications respond quickly to the SCM Ensure that all applications respond quickly to shutdown notifications (WM_QUERYENDSESSION and WM_ENDSESSION messages) Reduce delays in the shutdown path of services and applications by minimizing CPU, disk and network activity in response to shutdown notifications
29
Resources Windows Software Development Kit (SDK) http://msdn.microsoft.com/en-us/windows/bb980924.aspx http://msdn.microsoft.com/en-us/windows/bb980924.aspx Windows Performance Analysis Developer Center: http://msdn.microsoft.com/en-us/performance/default.aspx http://msdn.microsoft.com/en-us/performance/default.aspx Windows Performance Analysis forum: http://social.msdn.microsoft.com/Forums/en-US/wptk_v4/threads/ http://social.msdn.microsoft.com/Forums/en-US/wptk_v4/threads/ Event Tracing for Windows MSDN docs: http://msdn2.microsoft.com/en-us/library/aa363787.aspx http://msdn2.microsoft.com/en-us/library/aa363787.aspx On/Off Transition Performance Analysis of Windows Vista: http://www.microsoft.com/whdc/system/sysperf/On-Off_Transition.mspx http://www.microsoft.com/whdc/system/sysperf/On-Off_Transition.mspx Windows On/Off Transitions Solutions Guide: https://connect.microsoft.com/PartnerBeta/Downloads/DownloadDetails.aspx?DownloadID=17037 https://connect.microsoft.com/PartnerBeta/Downloads/DownloadDetails.aspx?DownloadID=17037 Battery Life Solutions Guide: http://www.microsoft.com/whdc/system/pnppwr/mobile_bat.mspx# http://www.microsoft.com/whdc/system/pnppwr/mobile_bat.mspx# Windows Internals: “Windows Internals 4 th edition” by Mark Russinovich and David Solomon
30
Track Resources →Want to find out which Windows Client sessions are best suited to help you in your deployment lifecycle? →Want to talk face-to-face with folks from the Windows Product Team? Meet us today at the Springboard Series Lounge, or visit us at www.microsoft.com/springboard www.microsoft.com/springboard Springboard Series The Springboard Series empowers you to select the right resources, at the right technical level, at the right point in your Windows® Client adoption and management process. Come see why Springboard Series is your destination for Windows 7.
31
Complete an evaluation on CommNet and enter to win!
32
© 2009 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.