Demystifying Visual Studio 2012 Performance Tools

3,137 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,137
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Hardware configuration events CPUs, hard drives, NICs, video card, and ACPI power statesDisk-level I/O every I/O on the system, IRP flags, operation time in ms, number of bytes, diskFile-level I/O every access to every file on the system (tie it to the disk I/Os above)Image layoutsfilenames, locations in memory, and PIDs for every image in the systemPage faultspointers to instructions and pages whenever a fault occursNetwork I/O all TCP and UDP actions, including connects/accepts, transmits, recieves, etc.Registry I/O all Registry key/value creation/deletions/changes, registry flushes, etc.Process and thread info all creations/deletions of processes and threads
  • Demystifying Visual Studio 2012 Performance Tools

    1. 1. Demystifying Visual Studio2012 Performance ToolsMartin Kulov | kulov.net www.devreach.com
    2. 2. You cannot manage,What you do not measurewww.devreach.com
    3. 3. You cannot Improve,What you do not measurewww.devreach.com
    4. 4. Trace Analysis Our code CLR COM WinRT Win32 API Operating System HDD RAM CPU LAN CPU Counterswww.devreach.com
    5. 5. CPU Counters• Hardware events – portable and platform – Instructions Retired – Non Halted Cycles – ITLB Misses – Branches Retired – Mis-predicted Branches – L2 Cache Read Misses – L2 Cache Read Referenceswww.devreach.com
    6. 6. Trace Analysis Our code CLR COM WinRT Windows Win32 API Perf Counters Operating System HDD RAM CPU LAN CPU Counterswww.devreach.com
    7. 7. Windows Performance Counters• They are …counters• Min interval – 1sec• Apps and kernel send Increment signals• Accessed by Windows API www.devreach.com
    8. 8. Perf Counters Demowww.devreach.com
    9. 9. Trace Analysis Our code CLR COM WinRT Windows Event Win32 API Perf Tracing Counters for Operating SystemWindows HDD RAM CPU LAN CPU Counterswww.devreach.com
    10. 10. Event Tracing for Windows• General purpose, high speed tracing• Buffering and logging in kernel• Faster than printf – 20,000 events per second while only using 5% CPU load on a P3 500MHz!• Provider, Consumer, Controller model• Over 700 providers in Win7, ~900 in Win8!• Aggregates all sources• Stack walking (on kernel events) www.devreach.com
    11. 11. ETW Kernel Providers• Hardware Configuration Events• Disk-level I/O• File-level I/O• Image Layouts• Page Faults• Network I/O• Registry I/O• Process and Thread info www.devreach.com
    12. 12. ETW Application Providers• Windows Firewall• WLAN, LAN• USB, Bluetooth• IIS, ASP.NET, CLR, HTTP.SYS• Security• … many more www.devreach.com
    13. 13. ETW Demowww.devreach.com
    14. 14. Side note: Symbols• _NT_SYMBOL_PATH=SRV*c:mss*http:// msdl.microsoft.com/download/symbols• Call stack information• Private managed code fields• Link to source code repositorywww.devreach.com
    15. 15. Concurrency Visualizer• Utilization• Threads• Cores• Stack Walking www.devreach.com
    16. 16. Trace Analysis Profiler Our code CLR COM WinRT Windows Event Win32 API Perf Tracing Counters for Operating SystemWindows HDD RAM CPU LAN CPU Counterswww.devreach.com
    17. 17. Profiler• Instrumentation• Sampling• Concurrency• Stack Walking www.devreach.com
    18. 18. Profiler setup• There can be only one• Uses environment variables – COR_ENABLE_PROFILING – COR_PROFILER – COR_XXX…• Profiler APIwww.devreach.com
    19. 19. Instrumentation• Profiler based• Requires full code recompilation• Best during development phase• Complete execution path www.devreach.com
    20. 20. Sampling• Profiler based• Data collection on sample intervals• Suitable for long runs• Call Stack www.devreach.com
    21. 21. Concurrency• Show resource contention• Based on Detours• Microsoft Research project now sold for $10k• http://research.microsoft.com/en-us/projects/detours/• Stack Walking www.devreach.com
    22. 22. Profiling extras• GC, Allocation• Tier Interaction• JavaScript• Production use• Licensing www.devreach.com
    23. 23. Profiler Demowww.devreach.com
    24. 24. Thank you! @kulov www.kulov.net www.linkedin.com/in/kulovMartin Kulov | kulov.net www.devreach.com

    ×