SlideShare a Scribd company logo
1 of 19
© Copyright SELA software & Education Labs Ltd. 14-18 Baruch Hirsch St.Bnei Brak 51202 Israel
www.sela.co.il
• Execution time
– CPU time, wall-clock time, kernel time vs. user time
• I/O requests
– Number of disk operations, number of bytes transferred
across the wire, number of files accessed
• Database access
– Sessions opened, transactions committed, grouping of
execution time by SQL statement
• OS and hardware
– System calls, page faults, cache misses, TLB misses
• A set of numeric data exposed by Windows or by
individual applications that can be sampled
programmatically
– Organized hierarchically into Categories, Instances, and
Counters
• Accessed using System.Diagnostics:
– PerformanceCounter, PerformanceCounterCategory
– Can expose your own counters as well
• Read with the built-in Performance Monitor MMC
snap-in (perfmon.exe)
Introduction to .NET Performance Measurement
• Supports managed and unmanaged code
– Part of Visual Studio 2010/2012 Premium/Ultimate
– Can be run stand-alone from the command-line
• Operation modes:
Sampling
•CPU-bound apps,
very low overhead
•Full program stacks
(including all system
DLLs)
•Tier interactions
Instrumentation
•I/O-bound apps,
CPU-bound apps,
higher overhead
•More detailed
timing data, limited
stacks (just my
code)
Allocations
•Details on who
allocated and what
•Managed code only Concurrency
• Periodically interrupt the application
– Timer (default = 10,000,000 clock cycles)
– Page faults
– System calls
– CPU performance counters (cache misses, branch
mispredictions, etc.)
• Walk the application’s stack
– Record the frames, no symbol resolution yet
– Very fast, small intrusion, little effect on profiled app
• Exclusive samples
– Function was on the top of
the stack
– Function is doing a lot of
individual work
• Inclusive samples
– Function was on the stack
(but not the top)
– Function causes a lot of
work to be done
Bar
Foo
Main
Top
+1 Inc
+1 Exc
+1 Inc
+1 Inc
Introduction to .NET Performance Measurement
• Samples ≠ Time
– Blocked functions don’t get samples
– There may be statistical errors (an “evasive” function that
never shows up during a sample)
• Very long runs are not necessary
– Long runs = more noise = less clarity
• Make sure you have debugging symbols
– Use the Microsoft symbol server,
http://msdl.microsoft.com/download/symbols
• The profiler instruments
the binary before it’s
launched
– Emits markers that
record function
execution times and
counts
– In other profilers, can
work at the line-level as
well – but very
expensive
void foo()
{
FUNC_ENTER(foo);
// do some work
CALL_ENTER(ExtCall);
// call another function
ExtCall();
CALL_EXIT(ExtCall);
// do some more work
FUNC_EXIT(foo);
}
• More detailed performance data
– Number of calls
– Actual Time (probe overhead is subtracted)
• Elapsed time
– Raw time spent in the function (wall clock time)
• Application time
– Probes are marked when kernel transitions occur between
two probes
– That time is discounted in Application time
• Memory allocations incur a significant cost
– The allocations are cheap, but the GC isn’t!
– You won’t always see the cost at the source, because the
allocating function runs quickly
• Profiling an application for excessive allocations may be
more important than CPU time
– Another aspect is diagnosing memory leaks or sources of
excess memory consumption
• Identifies the locations making the most allocations,
and lists the types and allocation counts
• Analyze the application’s concurrency characteristics
– CPU utilization – are all CPU cores active?
– Thread migration between cores
– Thread blocking patterns – why are threads
blocked/unblocked, preempted, executing?
– Resource contention – which threads are competing for the
same resources?
• In-depth analysis is very difficult – lots of information in
a very short time
• Common Patterns for Poorly-Behaved Multithreaded
Applications
http://msdn.microsoft.com/en-us/library/ee329530.aspx
• To get a quick result, an idea of where to focus
• To analyze sources of cache misses, page faults, and other environmental
factors
• To profile a running process (e.g. Web server) that can’t be restarted easily
Sampling
• To get more accurate results, function call counts
• To get wall-clock time information including block and wait timesInstrumentation
• To get a general idea of CPU utilization and thread migration
• To understand why threads are blocked and unblockedConcurrency
• xperf.exe: Command-line tool for ETW capturing and
processing
• xperfview.exe: Visual trace analysis tool
• xbootmgr.exe: On/off transition state capture tool
• PerfView.exe: ETW capture tool for managed apps
• Works on Windows Vista SP1 and above
• Turn tracing on: xperf -on <PROVIDER>
• Perform activities
• Capture a log: xperf -d <LOG_FILE_NAME>
• Analyze it: xperf <LOG_FILE_NAME>
Performance Counters
Visual Studio Profiler
Event Tracing for Windows

More Related Content

What's hot

USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patternsPeter Hlavaty
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon chinaPeter Hlavaty
 
Guardians of your CODE
Guardians of your CODEGuardians of your CODE
Guardians of your CODEPeter Hlavaty
 
When is something overflowing
When is something overflowingWhen is something overflowing
When is something overflowingPeter Hlavaty
 
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesPeter Hlavaty
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectPeter Hlavaty
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Tim Bunce
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware styleSander Demeester
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Pythoninfodox
 
Crash dump analysis - experience sharing
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharingJames Hsieh
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisSam Bowne
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgSam Bowne
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school introPeter Hlavaty
 
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014Yunong Xiao
 
Using the big guns: Advanced OS performance tools for troubleshooting databas...
Using the big guns: Advanced OS performance tools for troubleshooting databas...Using the big guns: Advanced OS performance tools for troubleshooting databas...
Using the big guns: Advanced OS performance tools for troubleshooting databas...Nikolay Savvinov
 
Advanced Debugging with WinDbg and SOS
Advanced Debugging with WinDbg and SOSAdvanced Debugging with WinDbg and SOS
Advanced Debugging with WinDbg and SOSSasha Goldshtein
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?Peter Hlavaty
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationShivam Mitra
 

What's hot (20)

USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Guardians of your CODE
Guardians of your CODEGuardians of your CODE
Guardians of your CODE
 
When is something overflowing
When is something overflowingWhen is something overflowing
When is something overflowing
 
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could Expect
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Python
 
Crash dump analysis - experience sharing
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharing
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school intro
 
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
 
Using the big guns: Advanced OS performance tools for troubleshooting databas...
Using the big guns: Advanced OS performance tools for troubleshooting databas...Using the big guns: Advanced OS performance tools for troubleshooting databas...
Using the big guns: Advanced OS performance tools for troubleshooting databas...
 
Advanced Debugging with WinDbg and SOS
Advanced Debugging with WinDbg and SOSAdvanced Debugging with WinDbg and SOS
Advanced Debugging with WinDbg and SOS
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
 
Packers
PackersPackers
Packers
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
 

Viewers also liked

TIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROL
TIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROLTIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROL
TIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROLMarvin Arteaga
 
C -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidas
C -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidasC -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidas
C -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidasWilder Vergara Castaño
 
Depardieu riskeert Belgische boete van 1200 euro
Depardieu riskeert Belgische boete van 1200 euroDepardieu riskeert Belgische boete van 1200 euro
Depardieu riskeert Belgische boete van 1200 euroThierry Debels
 
Рекомендательный аннотированный библиографический указатель. психологическая ...
Рекомендательный аннотированный библиографический указатель. психологическая ...Рекомендательный аннотированный библиографический указатель. психологическая ...
Рекомендательный аннотированный библиографический указатель. психологическая ...ZabGU
 
The Modern STS Approach: Mobilization Human Talent
The Modern STS Approach: Mobilization Human TalentThe Modern STS Approach: Mobilization Human Talent
The Modern STS Approach: Mobilization Human TalentSociotechnical Roundtable
 
Real World Problem Solving Using Application Performance Management 10
Real World Problem Solving Using Application Performance Management 10Real World Problem Solving Using Application Performance Management 10
Real World Problem Solving Using Application Performance Management 10CA Technologies
 
Finalupload survey resultspresentation
Finalupload survey resultspresentationFinalupload survey resultspresentation
Finalupload survey resultspresentationella potton
 
Enfermedades del-cultivo-de-lechosa-gio-y-juari
Enfermedades del-cultivo-de-lechosa-gio-y-juariEnfermedades del-cultivo-de-lechosa-gio-y-juari
Enfermedades del-cultivo-de-lechosa-gio-y-juariNathanael Belliard
 
5HBC CH12 Assignments, Vector/Polar
5HBC CH12 Assignments, Vector/Polar5HBC CH12 Assignments, Vector/Polar
5HBC CH12 Assignments, Vector/PolarA Jorge Garcia
 
Free jungle-animal-shadow-match-file
Free jungle-animal-shadow-match-fileFree jungle-animal-shadow-match-file
Free jungle-animal-shadow-match-fileRossyPalmaM Palma M
 
Ejercicios solucionados
Ejercicios solucionadosEjercicios solucionados
Ejercicios solucionadosJhoans Ruix
 
Dr Daniel J Clouse Resume
Dr Daniel J Clouse ResumeDr Daniel J Clouse Resume
Dr Daniel J Clouse ResumeDaniel Clouse
 

Viewers also liked (20)

TIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROL
TIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROLTIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROL
TIPOS DE CONTROL Y LOS MECANISMOS ESPICIFICOS DE CONTROL
 
Ethics
EthicsEthics
Ethics
 
003 cuarto bim_itzel (2)
003 cuarto bim_itzel (2)003 cuarto bim_itzel (2)
003 cuarto bim_itzel (2)
 
Dr. Owen Recommendation Letter HOLMAN
Dr. Owen Recommendation Letter HOLMANDr. Owen Recommendation Letter HOLMAN
Dr. Owen Recommendation Letter HOLMAN
 
Fitness plan14-abdomen-piel
Fitness plan14-abdomen-pielFitness plan14-abdomen-piel
Fitness plan14-abdomen-piel
 
C -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidas
C -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidasC -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidas
C -inetpub-webfolder-plaguicidas.apeamac.com-listado plaguicidas
 
Depardieu riskeert Belgische boete van 1200 euro
Depardieu riskeert Belgische boete van 1200 euroDepardieu riskeert Belgische boete van 1200 euro
Depardieu riskeert Belgische boete van 1200 euro
 
Рекомендательный аннотированный библиографический указатель. психологическая ...
Рекомендательный аннотированный библиографический указатель. психологическая ...Рекомендательный аннотированный библиографический указатель. психологическая ...
Рекомендательный аннотированный библиографический указатель. психологическая ...
 
The Modern STS Approach: Mobilization Human Talent
The Modern STS Approach: Mobilization Human TalentThe Modern STS Approach: Mobilization Human Talent
The Modern STS Approach: Mobilization Human Talent
 
Real World Problem Solving Using Application Performance Management 10
Real World Problem Solving Using Application Performance Management 10Real World Problem Solving Using Application Performance Management 10
Real World Problem Solving Using Application Performance Management 10
 
Modifiers of Morality
Modifiers of MoralityModifiers of Morality
Modifiers of Morality
 
Termodinâmica2
Termodinâmica2Termodinâmica2
Termodinâmica2
 
Finalupload survey resultspresentation
Finalupload survey resultspresentationFinalupload survey resultspresentation
Finalupload survey resultspresentation
 
Pamela 2
Pamela 2Pamela 2
Pamela 2
 
Unidaddidactica1b
Unidaddidactica1bUnidaddidactica1b
Unidaddidactica1b
 
Enfermedades del-cultivo-de-lechosa-gio-y-juari
Enfermedades del-cultivo-de-lechosa-gio-y-juariEnfermedades del-cultivo-de-lechosa-gio-y-juari
Enfermedades del-cultivo-de-lechosa-gio-y-juari
 
5HBC CH12 Assignments, Vector/Polar
5HBC CH12 Assignments, Vector/Polar5HBC CH12 Assignments, Vector/Polar
5HBC CH12 Assignments, Vector/Polar
 
Free jungle-animal-shadow-match-file
Free jungle-animal-shadow-match-fileFree jungle-animal-shadow-match-file
Free jungle-animal-shadow-match-file
 
Ejercicios solucionados
Ejercicios solucionadosEjercicios solucionados
Ejercicios solucionados
 
Dr Daniel J Clouse Resume
Dr Daniel J Clouse ResumeDr Daniel J Clouse Resume
Dr Daniel J Clouse Resume
 

Similar to Introduction to .NET Performance Measurement

Visual Studio 2013 Profiling
Visual Studio 2013 ProfilingVisual Studio 2013 Profiling
Visual Studio 2013 ProfilingDenis Dudaev
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.pptinfomerlin
 
Computer system organization
Computer system organizationComputer system organization
Computer system organizationSyed Zaid Irshad
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structuresWelly Dian Astika
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & ApplicationsMaulen Bale
 
Kernel security Concepts
Kernel security ConceptsKernel security Concepts
Kernel security ConceptsMohit Saxena
 
Real-Time Inverted Search NYC ASLUG Oct 2014
Real-Time Inverted Search NYC ASLUG Oct 2014Real-Time Inverted Search NYC ASLUG Oct 2014
Real-Time Inverted Search NYC ASLUG Oct 2014Bryan Bende
 
Operating system by ajay yadav shq upr
Operating system by ajay yadav shq uprOperating system by ajay yadav shq upr
Operating system by ajay yadav shq uprAjay Yadav
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systemsRai University
 
Introduction to operating system, system calls and interrupts
Introduction to operating system, system calls and interruptsIntroduction to operating system, system calls and interrupts
Introduction to operating system, system calls and interruptsShivam Mitra
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsRai University
 

Similar to Introduction to .NET Performance Measurement (20)

Internals of Presto Service
Internals of Presto ServiceInternals of Presto Service
Internals of Presto Service
 
Visual Studio 2013 Profiling
Visual Studio 2013 ProfilingVisual Studio 2013 Profiling
Visual Studio 2013 Profiling
 
Unit 4
Unit  4Unit  4
Unit 4
 
Ch3 processes
Ch3   processesCh3   processes
Ch3 processes
 
In out system
In out systemIn out system
In out system
 
Ch12 io systems
Ch12   io systemsCh12   io systems
Ch12 io systems
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.ppt
 
Os
OsOs
Os
 
Thread
ThreadThread
Thread
 
Computer system organization
Computer system organizationComputer system organization
Computer system organization
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structures
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
Kernel security Concepts
Kernel security ConceptsKernel security Concepts
Kernel security Concepts
 
Real-Time Inverted Search NYC ASLUG Oct 2014
Real-Time Inverted Search NYC ASLUG Oct 2014Real-Time Inverted Search NYC ASLUG Oct 2014
Real-Time Inverted Search NYC ASLUG Oct 2014
 
Operating system by ajay yadav shq upr
Operating system by ajay yadav shq uprOperating system by ajay yadav shq upr
Operating system by ajay yadav shq upr
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systems
 
Introduction to operating system, system calls and interrupts
Introduction to operating system, system calls and interruptsIntroduction to operating system, system calls and interrupts
Introduction to operating system, system calls and interrupts
 
Breaking data
Breaking dataBreaking data
Breaking data
 
Ch04 threads
Ch04 threadsCh04 threads
Ch04 threads
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 

More from Sasha Goldshtein

Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing LandscapeSasha Goldshtein
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerSasha Goldshtein
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF AbyssSasha Goldshtein
 
Visual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET FrameworkVisual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET FrameworkSasha Goldshtein
 
Swift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS XSwift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS XSasha Goldshtein
 
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with XamarinC# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with XamarinSasha Goldshtein
 
Modern Backends for Mobile Apps
Modern Backends for Mobile AppsModern Backends for Mobile Apps
Modern Backends for Mobile AppsSasha Goldshtein
 
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Sasha Goldshtein
 
Mastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and ProductionMastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and ProductionSasha Goldshtein
 
Delivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesDelivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesSasha Goldshtein
 
Building Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET BackendBuilding Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET BackendSasha Goldshtein
 
Building iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile ServicesBuilding iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile ServicesSasha Goldshtein
 
Attacking Web Applications
Attacking Web ApplicationsAttacking Web Applications
Attacking Web ApplicationsSasha Goldshtein
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesSasha Goldshtein
 
First Steps in Android Development
First Steps in Android DevelopmentFirst Steps in Android Development
First Steps in Android DevelopmentSasha Goldshtein
 
First Steps in iOS Development
First Steps in iOS DevelopmentFirst Steps in iOS Development
First Steps in iOS DevelopmentSasha Goldshtein
 

More from Sasha Goldshtein (20)

Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
Visual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET FrameworkVisual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET Framework
 
Swift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS XSwift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS X
 
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with XamarinC# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
 
Modern Backends for Mobile Apps
Modern Backends for Mobile AppsModern Backends for Mobile Apps
Modern Backends for Mobile Apps
 
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
 
Mastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and ProductionMastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and Production
 
Introduction to RavenDB
Introduction to RavenDBIntroduction to RavenDB
Introduction to RavenDB
 
State of the Platforms
State of the PlatformsState of the Platforms
State of the Platforms
 
Delivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesDelivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in Minutes
 
Building Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET BackendBuilding Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET Backend
 
Building iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile ServicesBuilding iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile Services
 
Task and Data Parallelism
Task and Data ParallelismTask and Data Parallelism
Task and Data Parallelism
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
 
Attacking Web Applications
Attacking Web ApplicationsAttacking Web Applications
Attacking Web Applications
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
First Steps in Android Development
First Steps in Android DevelopmentFirst Steps in Android Development
First Steps in Android Development
 
First Steps in iOS Development
First Steps in iOS DevelopmentFirst Steps in iOS Development
First Steps in iOS Development
 

Recently uploaded

Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum ComputingGDSC PJATK
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
20200723_insight_release_plan
20200723_insight_release_plan20200723_insight_release_plan
20200723_insight_release_planJamie (Taka) Wang
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfAnna Loughnan Colquhoun
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncObject Automation
 

Recently uploaded (20)

Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum Computing
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
20200723_insight_release_plan
20200723_insight_release_plan20200723_insight_release_plan
20200723_insight_release_plan
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdf
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation Inc
 

Introduction to .NET Performance Measurement

  • 1. © Copyright SELA software & Education Labs Ltd. 14-18 Baruch Hirsch St.Bnei Brak 51202 Israel www.sela.co.il
  • 2. • Execution time – CPU time, wall-clock time, kernel time vs. user time • I/O requests – Number of disk operations, number of bytes transferred across the wire, number of files accessed • Database access – Sessions opened, transactions committed, grouping of execution time by SQL statement • OS and hardware – System calls, page faults, cache misses, TLB misses
  • 3. • A set of numeric data exposed by Windows or by individual applications that can be sampled programmatically – Organized hierarchically into Categories, Instances, and Counters • Accessed using System.Diagnostics: – PerformanceCounter, PerformanceCounterCategory – Can expose your own counters as well • Read with the built-in Performance Monitor MMC snap-in (perfmon.exe)
  • 5. • Supports managed and unmanaged code – Part of Visual Studio 2010/2012 Premium/Ultimate – Can be run stand-alone from the command-line • Operation modes: Sampling •CPU-bound apps, very low overhead •Full program stacks (including all system DLLs) •Tier interactions Instrumentation •I/O-bound apps, CPU-bound apps, higher overhead •More detailed timing data, limited stacks (just my code) Allocations •Details on who allocated and what •Managed code only Concurrency
  • 6. • Periodically interrupt the application – Timer (default = 10,000,000 clock cycles) – Page faults – System calls – CPU performance counters (cache misses, branch mispredictions, etc.) • Walk the application’s stack – Record the frames, no symbol resolution yet – Very fast, small intrusion, little effect on profiled app
  • 7. • Exclusive samples – Function was on the top of the stack – Function is doing a lot of individual work • Inclusive samples – Function was on the stack (but not the top) – Function causes a lot of work to be done Bar Foo Main Top +1 Inc +1 Exc +1 Inc +1 Inc
  • 9. • Samples ≠ Time – Blocked functions don’t get samples – There may be statistical errors (an “evasive” function that never shows up during a sample) • Very long runs are not necessary – Long runs = more noise = less clarity • Make sure you have debugging symbols – Use the Microsoft symbol server, http://msdl.microsoft.com/download/symbols
  • 10. • The profiler instruments the binary before it’s launched – Emits markers that record function execution times and counts – In other profilers, can work at the line-level as well – but very expensive void foo() { FUNC_ENTER(foo); // do some work CALL_ENTER(ExtCall); // call another function ExtCall(); CALL_EXIT(ExtCall); // do some more work FUNC_EXIT(foo); }
  • 11. • More detailed performance data – Number of calls – Actual Time (probe overhead is subtracted) • Elapsed time – Raw time spent in the function (wall clock time) • Application time – Probes are marked when kernel transitions occur between two probes – That time is discounted in Application time
  • 12. • Memory allocations incur a significant cost – The allocations are cheap, but the GC isn’t! – You won’t always see the cost at the source, because the allocating function runs quickly • Profiling an application for excessive allocations may be more important than CPU time – Another aspect is diagnosing memory leaks or sources of excess memory consumption
  • 13. • Identifies the locations making the most allocations, and lists the types and allocation counts
  • 14. • Analyze the application’s concurrency characteristics – CPU utilization – are all CPU cores active? – Thread migration between cores – Thread blocking patterns – why are threads blocked/unblocked, preempted, executing? – Resource contention – which threads are competing for the same resources? • In-depth analysis is very difficult – lots of information in a very short time
  • 15. • Common Patterns for Poorly-Behaved Multithreaded Applications http://msdn.microsoft.com/en-us/library/ee329530.aspx
  • 16. • To get a quick result, an idea of where to focus • To analyze sources of cache misses, page faults, and other environmental factors • To profile a running process (e.g. Web server) that can’t be restarted easily Sampling • To get more accurate results, function call counts • To get wall-clock time information including block and wait timesInstrumentation • To get a general idea of CPU utilization and thread migration • To understand why threads are blocked and unblockedConcurrency
  • 17. • xperf.exe: Command-line tool for ETW capturing and processing • xperfview.exe: Visual trace analysis tool • xbootmgr.exe: On/off transition state capture tool • PerfView.exe: ETW capture tool for managed apps • Works on Windows Vista SP1 and above
  • 18. • Turn tracing on: xperf -on <PROVIDER> • Perform activities • Capture a log: xperf -d <LOG_FILE_NAME> • Analyze it: xperf <LOG_FILE_NAME>
  • 19. Performance Counters Visual Studio Profiler Event Tracing for Windows