Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PerfView: The Ultimate .NET Performance Tool

422 views

Published on

Video and slides synchronized, mp3 and slide download available at URL https://bit.ly/2J6ESmR.

Sasha Goldshtein talks about PerfView - an open source tool for .NET performance diagnosis in production environments. He uses PerfView to systematically measure and improve CPU time, wall-clock time, and memory usage (yes, PerfView can solve memory leaks as well!). Filmed at qconlondon.com.

Sasha Goldshtein is the CTO of Sela Group, a Microsoft MVP and Regional Director. He is an active open source contributor to projects focused on system diagnostics, performance monitoring, and tracing - across multiple operating systems and runtimes. He authored training courses on Linux performance optimization, event tracing, production debugging, mobile application development, and modern C++.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

PerfView: The Ultimate .NET Performance Tool

  1. 1. PerfView Measure and Improve Your App’s Performance for Free Sasha Goldshtein CTO, Sela Group @goldshtn 1
  2. 2. InfoQ.com: News & Community Site Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ perfview-net • Over 1,000,000 software developers, architects and CTOs read the site world- wide every month • 250,000 senior developers subscribe to our weekly newsletter • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • 2 dedicated podcast channels: The InfoQ Podcast, with a focus on Architecture and The Engineering Culture Podcast, with a focus on building • 96 deep dives on innovative topics packed as downloadable emags and minibooks • Over 40 new content items per week
  3. 3. Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide Presented at QCon London www.qconlondon.com
  4. 4. Performance metrics and simulations Development- time profiling Performance and load tests Production- time performance investigations Continuous low-overhead monitoring 2
  5. 5. One Production Performance Investigation • Customer pain point: • Very infrequently, user requests that save and load files are failing • “Detailed” performance monitoring report (1 day): • Average storage array latency is 5ms, so there’s no problem • “Super-detailed” performance monitoring report (3 days): • Per-minute average storage array latency numbers • Average of averages is 5ms, so there’s no problem 3
  6. 6. Use a Profiler 4
  7. 7. Problems with Traditional Profilers • Invasiveness • Overhead • Trace size • Licensing costs 5
  8. 8. Event Tracing for Windows (ETW) • High-performance logging framework with structured payloads and stack trace support • Used widely across Windows, .NET, drivers, services, and more 6
  9. 9. ETW Roles ProvidersProvidersProviders ProvidersProvidersConsumers ProvidersControllers Event tracing session events Log filesevents real-time logged events buffers 7
  10. 10. Some Interesting Providers • Kernel Sample (Profile) provider • Produces a call stack every 1ms of CPU execution time • CLR GC and SampAlloc provider • Produces events for garbage collections and object allocation samples • Kernel Context Switch provider • Produces events for context switches, enables tracking off- and on-CPU transitions (thread blocked time) • Kernel FileIO provider • Produces events for each file I/O operation and its duration 8
  11. 11. What’s In An ETW Recording? • A huge list of events, think millions • Events have multiple columns (payload), think Excel spreadsheet • Useless without additional processing 9
  12. 12. PerfView • ETW collection and analysis tool authored by Vance Morrison of the Microsoft .NET team • Huge variety of performance investigation scenarios • Steep(ish) learning curve • Watch training videos! 10
  13. 13. Demo: Using PerfView for CPU and blocked time investigations 11
  14. 14. Sidebar: It’s All In The Visualization 12
  15. 15. Demo: Using PerfView to investigate startup performance 13
  16. 16. Demo: Using PerfView to reduce memory allocations 14
  17. 17. Memory Analysis with PerfView • PerfView can capture optimized heap snapshots • Sampling, spanning tree generation, object content dropping • Compare snapshots to determine which objects are being allocated and not freed • Determine which GC root paths keep objects alive 15
  18. 18. Demo: Using PerfView to diagnose a memory leak 16
  19. 19. Summary • ETW is the performance monitoring framework of today and the future • PerfView is a free, universal analysis tool for CPU, memory, and thread time investigations • Detailed performance monitoring in production is possible and required 17
  20. 20. Thank You! Sasha Goldshtein @goldshtn 18
  21. 21. Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ perfview-net

×