SlideShare a Scribd company logo
1 of 26
Download to read offline
Visual Studio Profiler
let’s start a profiling session !
Maxime Lemaitre – 23/07/2013
Profiling
Tools
• Let developers measure, evaluate, and target performance-related
issues in their code
– CPU, Memory, Concurrency, ADO.NET…
• Command-line tools but fully integrated into the IDE
• Since VS 2012, available in Pro Version
• Really powerful tools but poorly documented/blogged
• Needs knowledge on the application and on .net framework
Introduction on MSDN
2
Profiling Tools Introduction
Here is the general process :
• Configure the performance session by specifying
the profiling method and the data that you want
to collect.
• Collect profiling data by running the application
in the performance session.
• Analyze the data to identify the performance
issue.
• Modify code with the goal to increases the
application performance of the code
• Collect profiling data on the changed code, and
compare the profiling data of the original and
changed data.
• Generate a report that documents the increase in
performance.
3
Profiling Workflow
There are 4 profiling available methods
• CPU Sampling
– Collects application statistics that are useful for
initial analysis and for analyzing CPU utilization
issues.
• Instrumentation
– Collects detailed timing data that are useful for
focused analysis and for analyzing input/output
performance issues.
• .NET Memory Allocation
– Collects .NET Framework memory allocation
data by using the sampling profiling method.
• Concurrency
– Collects numeric resource contention data.
4
Choosing a Profiling Method
Can be attached to
a running process !
The sampling profiling method of the Profiling Tools interrupts the computer processor at
set intervals and collects the function call stack.
The profiler analysis determines whether the processor is executing code in the target
process. If the processor is not executing code in the target process, the sample is
discarded.
• Inclusive samples
– The total number of samples that are collected during the execution of the target function.
– This includes samples that are collected during the direct execution of the function code and
samples that are collected during the execution of child functions that are called by the target
function.
• Exclusive samples
– The number of samples that are collected during the direct execution of the instructions of
the target function.
– Exclusive samples do not include samples that are collected during the execution of
functions that are called by the target function.
• Inclusive percent
• Exclusive percent
5
Sampling Profiling Method
Too Many Samples ?
- Slow piece of code
- Too many calls to a piece of code
=> For sure, there is something to optimize
The instrumentation profiling method of the Profiling Tools records detailed timing
information for the function calls, lines, and instructions in the profiled application
The instrumentation method injects code at the start and end of target functions in the
profiled binary, and before and after each call by those functions to other functions. The
injected code records interval between collects and OS operations.
• Elapsed Inclusive values
– The total time that was spent executing a function and its child functions.
• Elapsed Exclusive values
– The time that was spent executing a function, excluding time that was spent in child
functions.
• Application Inclusive values
– The time that was spent executing a function and its child functions, excluding time that was
spent in operating system events.
• Application Exclusive values
– The time that was spent executing a function, excluding the time that was spent in child
functions and the time that was spent in operating system events.
• Elapsed Inclusive & Exclusive percent
• Application Inclusive & Exclusive percent 6
Instrumentation Profiling Method
The .NET memory allocation profiling method of Profiling Tools collects information
about the size and number of objects that were created in an allocation or destroyed in a
garbage collection and a few additional information.
The memory profiler interrupts the computer processor at each allocation of a .NET
Framework object in a profiled application. When object lifetime data is also collected, the
profiler interrupts the processor after each .NET Framework garbage collection. The data
is aggregated for each profiled function and for each type of object.
• Allocation Data
– Total counts and sizes of the allocated or destroyed memory objects
• Lifetime Data
– Displays the number and size of the objects and the generation when they are reclaimed
7
Memory Profiling Method
Resource contention profiling collects detailed call stack information each time
competing threads in an application are forced to wait for access to a shared resource.
Resource contention reports display the total number of contentions and the total time
that was spent waiting for a resource for the modules, functions, source code lines, and
instructions in which the waiting occured.
• Inclusive values
– Contentions that were caused by child functions that were called by the function are included
in inclusive values.
• Exclusive values
– Contentions caused by child functions are not included. The exclusive time for the function
also includes only the wait times that were caused by statements in the function body.
8
Concurrency profiling method
• Adds information to a profiling data file about synchronous ADO.NET calls
between an application and a SQL Server database
• Can be added to profiling data that is collected with the sampling,
instrumentation, .NET memory, or concurrency methods
9
Tier Interaction
Hidden profiling method
For example, 1204
requests to the
Casino Home Page
10
Profiling Quick Start
this often begins
with a wizard …
11
Profiling Wizard
Profiling Method Targets
TIP ?
Js ?
• Enables us to configure and start performance sessions
– Created/Filled by Performance Wizard
12
Performance Explorer
Session Name
The name of the session. Right-click the session name
to edit the session properties
Targets
Binaries that are to be profiled in the session. Can be a
binary, a VS project, or Web site. Each target have own
Properties.
Reports
Files that are generated for the session. Right-click a
report name to open, remove, or export a profiler data
file. Can compare two profiler data files.
13
Profiling…
Pause
suspend data collection
Stop profiling
end the profiling session
When profiling you have nothing to do :
- Let is run for standalone app (Console, Test, ..)
- Navigate between pages/forms (Web Site or Desktop)
1 - Hot Path
branch of your application's call tree
that was most active when data was
collected
2 - Functions Doing the Most
Individual Work.
functions with the highest exclusive
samples
3 - Summary Timeline
timeline graph & CPU usage
4 - Error List
uses a set of rules to suggest ways of
improving the profiling run and to
identify possible performance problems
14
Summary View
Summary depends on Profiling method !
There are also a few others Views
of profiling data files are displayed
• Call Tree
• Modules View
• Functions View
• Object Lifetime View
• Thread Details View
• Tier Interaction Views
• …
15
Analysis Results
Demos
16
17
Demo #1
ASP.NET MVC 4 Sample (Magazine website)
Many Samples in Dal code and many calls to the db. Missing cache ?
18
Demo #2
Micro Benchmarking a Translation Helper (in Unit Test)
More than 93% of elapsed time is spent on Regex.Replace …
For sure, there is something to improve in the helper.
19
Demo #3
Task cancellation Helper
For 100 000 tests, 300 000 tasks were allocated. Ouh !
For sure, memory consumption is not optimal when task is already completed.
• Profiling data can be collected through the ASP.NET profiler when we run a
web or a load test
– Limited to sampling and tier interaction data
– Not appropriate for long runs (profiler file can become large …)
• Really powerful if you have real scenarios & test cases
20
Profiling ASP.NET Web & Load Tests
You just have to select
ASP.NET profiler for your test
settings
• Instrumentation profiling can provide a greater level of detail ; this means
that more data is collected and instrumentation is more likely to impact the
performance
• The Visual Studio profiler provides an API for controlling data collection
from within an application
– allow us to limit the amount of data that is collected during a profiling session.
Simply add a reference to ToolsMicrosoft.VisualStudio.Profiler.dll
(VSDirToolsPerformance Tools)
21
Profiler APIs
Right-click a test and choose Profile Test to
run performance analysis on a single unit test
22
Profiling Unit Tests
Since VS 2012 update 2
The test runs as usual followed by
the analysis (sampling method).
When analysis completes, you’ll see
the classic summary view
Questions ?
23
• http://msdn.microsoft.com/en-us/library/ms182372.aspx
• http://msdn.microsoft.com/en-us/library/z9z62c29.aspx
• http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-
profiling-with-visual-studio-2012.aspx
• http://blogs.msdn.com/b/anilchandra/archive/2012/09/24/test.aspx
• http://blogs.msdn.com/b/visualstudioalm/archive/tags/diagnostics/
• http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-
profiling-with-visual-studio-2012.aspx
24
Appendices & References
Find out more
• On https://techblog.betclicgroup.com/
About Betclic
• Betclic Everest Group, one of the world leaders in online gaming, has a unique
portfolio comprising various complementary international brands: Betclic, Everest
Gaming, bet-at-home.com, Expekt…
• Active in 100 countries with more than 12 million customers worldwide, the Group is
committed to promoting secure and responsible gaming and is a member of several
international professional associations including the EGBA (European Gaming and
Betting Association) and the ESSA (European Sports Security Association).
• Through our brands, Betclic Everest Group places expertise, technological know-how
and security at the heart of our strategy to deliver an on-line gaming offer attuned to
the passion of our players.

More Related Content

What's hot

게임서버프로그래밍 #4 - 멀티스레드 프로그래밍
게임서버프로그래밍 #4 - 멀티스레드 프로그래밍게임서버프로그래밍 #4 - 멀티스레드 프로그래밍
게임서버프로그래밍 #4 - 멀티스레드 프로그래밍Seungmo Koo
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & InconsistencyGreenD0g
 
Word2Vec model to generate synonyms on the fly in Apache Lucene.pdf
Word2Vec model to generate synonyms on the fly in Apache Lucene.pdfWord2Vec model to generate synonyms on the fly in Apache Lucene.pdf
Word2Vec model to generate synonyms on the fly in Apache Lucene.pdfSease
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster OpenCredo
 
FIDO2 Specifications Overview
FIDO2 Specifications OverviewFIDO2 Specifications Overview
FIDO2 Specifications OverviewFIDO Alliance
 
Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellN Masahiro
 
Django Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIDjango Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIMarcos Pereira
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!Alex Borysov
 
Suricata: A Decade Under the Influence (of packet sniffing)
Suricata: A Decade Under the Influence (of packet sniffing)Suricata: A Decade Under the Influence (of packet sniffing)
Suricata: A Decade Under the Influence (of packet sniffing)Jason Williams
 
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석uEngine Solutions
 
[213]monitoringwithscouter 이건희
[213]monitoringwithscouter 이건희[213]monitoringwithscouter 이건희
[213]monitoringwithscouter 이건희NAVER D2
 
Advanced Ops Manager Topics
Advanced Ops Manager TopicsAdvanced Ops Manager Topics
Advanced Ops Manager TopicsMongoDB
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우jieunsys
 
Nginx internals
Nginx internalsNginx internals
Nginx internalsliqiang xu
 
Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12N Masahiro
 

What's hot (20)

게임서버프로그래밍 #4 - 멀티스레드 프로그래밍
게임서버프로그래밍 #4 - 멀티스레드 프로그래밍게임서버프로그래밍 #4 - 멀티스레드 프로그래밍
게임서버프로그래밍 #4 - 멀티스레드 프로그래밍
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & Inconsistency
 
Word2Vec model to generate synonyms on the fly in Apache Lucene.pdf
Word2Vec model to generate synonyms on the fly in Apache Lucene.pdfWord2Vec model to generate synonyms on the fly in Apache Lucene.pdf
Word2Vec model to generate synonyms on the fly in Apache Lucene.pdf
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
 
FIDO2 Specifications Overview
FIDO2 Specifications OverviewFIDO2 Specifications Overview
FIDO2 Specifications Overview
 
Firebase slide
Firebase slideFirebase slide
Firebase slide
 
Ipfs
IpfsIpfs
Ipfs
 
Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshell
 
Django Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIDjango Rest Framework - Building a Web API
Django Rest Framework - Building a Web API
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!
 
Suricata: A Decade Under the Influence (of packet sniffing)
Suricata: A Decade Under the Influence (of packet sniffing)Suricata: A Decade Under the Influence (of packet sniffing)
Suricata: A Decade Under the Influence (of packet sniffing)
 
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석Open source apm scouter를 통한 관제  관리 jadecross 정환열 수석
Open source apm scouter를 통한 관제 관리 jadecross 정환열 수석
 
[213]monitoringwithscouter 이건희
[213]monitoringwithscouter 이건희[213]monitoringwithscouter 이건희
[213]monitoringwithscouter 이건희
 
libSQL
libSQLlibSQL
libSQL
 
Advanced Ops Manager Topics
Advanced Ops Manager TopicsAdvanced Ops Manager Topics
Advanced Ops Manager Topics
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
The Elastic ELK Stack
The Elastic ELK StackThe Elastic ELK Stack
The Elastic ELK Stack
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12Dive into Fluentd plugin v0.12
Dive into Fluentd plugin v0.12
 
Apache Flink Hands On
Apache Flink Hands OnApache Flink Hands On
Apache Flink Hands On
 

Similar to Visual Studio Profiler

Visual Studio 2013 Profiling
Visual Studio 2013 ProfilingVisual Studio 2013 Profiling
Visual Studio 2013 ProfilingDenis Dudaev
 
_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt
_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt
_VoicePPT_QA_Testing_Training_4_Days_Schedule.pptAnilKumarARS
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 
Application Performance Tuning Techniques
Application Performance Tuning TechniquesApplication Performance Tuning Techniques
Application Performance Tuning TechniquesRam Nagesh
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool OverviewANKUR-BA
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools OverviewSachin-QA
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...Lohika_Odessa_TechTalks
 
Analysis concepts and principles
Analysis concepts and principlesAnalysis concepts and principles
Analysis concepts and principlessaurabhshertukde
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!Richard Robinson
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools OverviewMurageppa-QA
 
Fundamentals of software development
Fundamentals of software developmentFundamentals of software development
Fundamentals of software developmentPratik Devmurari
 
Se6162 analysis concept and principles
Se6162 analysis concept and principlesSe6162 analysis concept and principles
Se6162 analysis concept and principleskhaerul azmi
 
Performance Testing
Performance TestingPerformance Testing
Performance TestingAnu Shaji
 
Vehicle management system
Vehicle management systemVehicle management system
Vehicle management systemWeTheCoders
 
Vehicle management system
Vehicle management systemVehicle management system
Vehicle management systemwethecodershelp
 
Service quality monitoring system architecture
Service quality monitoring system architectureService quality monitoring system architecture
Service quality monitoring system architectureMatsuo Sawahashi
 

Similar to Visual Studio Profiler (20)

Visual Studio 2013 Profiling
Visual Studio 2013 ProfilingVisual Studio 2013 Profiling
Visual Studio 2013 Profiling
 
_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt
_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt
_VoicePPT_QA_Testing_Training_4_Days_Schedule.ppt
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Application Performance Tuning Techniques
Application Performance Tuning TechniquesApplication Performance Tuning Techniques
Application Performance Tuning Techniques
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
 
Gcs day1
Gcs day1Gcs day1
Gcs day1
 
software engineering
software engineering software engineering
software engineering
 
Analysis concepts and principles
Analysis concepts and principlesAnalysis concepts and principles
Analysis concepts and principles
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Fundamentals of software development
Fundamentals of software developmentFundamentals of software development
Fundamentals of software development
 
Se6162 analysis concept and principles
Se6162 analysis concept and principlesSe6162 analysis concept and principles
Se6162 analysis concept and principles
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Vehicle management system
Vehicle management systemVehicle management system
Vehicle management system
 
Vehicle management system
Vehicle management systemVehicle management system
Vehicle management system
 
Service quality monitoring system architecture
Service quality monitoring system architectureService quality monitoring system architecture
Service quality monitoring system architecture
 
DITEC - Software Engineering
DITEC - Software EngineeringDITEC - Software Engineering
DITEC - Software Engineering
 
ADF Performance Monitor
ADF Performance MonitorADF Performance Monitor
ADF Performance Monitor
 

More from Betclic Everest Group Tech Team

Mini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedMini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedBetclic Everest Group Tech Team
 

More from Betclic Everest Group Tech Team (20)

Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)
 
Mini training - Moving to xUnit.net
Mini training - Moving to xUnit.netMini training - Moving to xUnit.net
Mini training - Moving to xUnit.net
 
Mini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure StorageMini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure Storage
 
Akka.Net
Akka.NetAkka.Net
Akka.Net
 
Mini training- Scenario Driven Design
Mini training- Scenario Driven DesignMini training- Scenario Driven Design
Mini training- Scenario Driven Design
 
Email Management in Outlook
Email Management in OutlookEmail Management in Outlook
Email Management in Outlook
 
Mini-Training: SSO with Windows Identity Foundation
Mini-Training: SSO with Windows Identity FoundationMini-Training: SSO with Windows Identity Foundation
Mini-Training: SSO with Windows Identity Foundation
 
Training - What is Performance ?
Training  - What is Performance ?Training  - What is Performance ?
Training - What is Performance ?
 
Mini-Training: Docker
Mini-Training: DockerMini-Training: Docker
Mini-Training: Docker
 
Mini Training Flyway
Mini Training FlywayMini Training Flyway
Mini Training Flyway
 
Mini-Training: NDepend
Mini-Training: NDependMini-Training: NDepend
Mini-Training: NDepend
 
Management 3.0 Workout
Management 3.0 WorkoutManagement 3.0 Workout
Management 3.0 Workout
 
Lean for Business
Lean for BusinessLean for Business
Lean for Business
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Training – Going Async
Training – Going AsyncTraining – Going Async
Training – Going Async
 
Mini-Training: Mobile UX Trends
Mini-Training: Mobile UX TrendsMini-Training: Mobile UX Trends
Mini-Training: Mobile UX Trends
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Mini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedMini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation Demystified
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 

Recently uploaded

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Visual Studio Profiler

  • 1. Visual Studio Profiler let’s start a profiling session ! Maxime Lemaitre – 23/07/2013 Profiling Tools
  • 2. • Let developers measure, evaluate, and target performance-related issues in their code – CPU, Memory, Concurrency, ADO.NET… • Command-line tools but fully integrated into the IDE • Since VS 2012, available in Pro Version • Really powerful tools but poorly documented/blogged • Needs knowledge on the application and on .net framework Introduction on MSDN 2 Profiling Tools Introduction
  • 3. Here is the general process : • Configure the performance session by specifying the profiling method and the data that you want to collect. • Collect profiling data by running the application in the performance session. • Analyze the data to identify the performance issue. • Modify code with the goal to increases the application performance of the code • Collect profiling data on the changed code, and compare the profiling data of the original and changed data. • Generate a report that documents the increase in performance. 3 Profiling Workflow
  • 4. There are 4 profiling available methods • CPU Sampling – Collects application statistics that are useful for initial analysis and for analyzing CPU utilization issues. • Instrumentation – Collects detailed timing data that are useful for focused analysis and for analyzing input/output performance issues. • .NET Memory Allocation – Collects .NET Framework memory allocation data by using the sampling profiling method. • Concurrency – Collects numeric resource contention data. 4 Choosing a Profiling Method Can be attached to a running process !
  • 5. The sampling profiling method of the Profiling Tools interrupts the computer processor at set intervals and collects the function call stack. The profiler analysis determines whether the processor is executing code in the target process. If the processor is not executing code in the target process, the sample is discarded. • Inclusive samples – The total number of samples that are collected during the execution of the target function. – This includes samples that are collected during the direct execution of the function code and samples that are collected during the execution of child functions that are called by the target function. • Exclusive samples – The number of samples that are collected during the direct execution of the instructions of the target function. – Exclusive samples do not include samples that are collected during the execution of functions that are called by the target function. • Inclusive percent • Exclusive percent 5 Sampling Profiling Method Too Many Samples ? - Slow piece of code - Too many calls to a piece of code => For sure, there is something to optimize
  • 6. The instrumentation profiling method of the Profiling Tools records detailed timing information for the function calls, lines, and instructions in the profiled application The instrumentation method injects code at the start and end of target functions in the profiled binary, and before and after each call by those functions to other functions. The injected code records interval between collects and OS operations. • Elapsed Inclusive values – The total time that was spent executing a function and its child functions. • Elapsed Exclusive values – The time that was spent executing a function, excluding time that was spent in child functions. • Application Inclusive values – The time that was spent executing a function and its child functions, excluding time that was spent in operating system events. • Application Exclusive values – The time that was spent executing a function, excluding the time that was spent in child functions and the time that was spent in operating system events. • Elapsed Inclusive & Exclusive percent • Application Inclusive & Exclusive percent 6 Instrumentation Profiling Method
  • 7. The .NET memory allocation profiling method of Profiling Tools collects information about the size and number of objects that were created in an allocation or destroyed in a garbage collection and a few additional information. The memory profiler interrupts the computer processor at each allocation of a .NET Framework object in a profiled application. When object lifetime data is also collected, the profiler interrupts the processor after each .NET Framework garbage collection. The data is aggregated for each profiled function and for each type of object. • Allocation Data – Total counts and sizes of the allocated or destroyed memory objects • Lifetime Data – Displays the number and size of the objects and the generation when they are reclaimed 7 Memory Profiling Method
  • 8. Resource contention profiling collects detailed call stack information each time competing threads in an application are forced to wait for access to a shared resource. Resource contention reports display the total number of contentions and the total time that was spent waiting for a resource for the modules, functions, source code lines, and instructions in which the waiting occured. • Inclusive values – Contentions that were caused by child functions that were called by the function are included in inclusive values. • Exclusive values – Contentions caused by child functions are not included. The exclusive time for the function also includes only the wait times that were caused by statements in the function body. 8 Concurrency profiling method
  • 9. • Adds information to a profiling data file about synchronous ADO.NET calls between an application and a SQL Server database • Can be added to profiling data that is collected with the sampling, instrumentation, .NET memory, or concurrency methods 9 Tier Interaction Hidden profiling method For example, 1204 requests to the Casino Home Page
  • 10. 10 Profiling Quick Start this often begins with a wizard …
  • 12. • Enables us to configure and start performance sessions – Created/Filled by Performance Wizard 12 Performance Explorer Session Name The name of the session. Right-click the session name to edit the session properties Targets Binaries that are to be profiled in the session. Can be a binary, a VS project, or Web site. Each target have own Properties. Reports Files that are generated for the session. Right-click a report name to open, remove, or export a profiler data file. Can compare two profiler data files.
  • 13. 13 Profiling… Pause suspend data collection Stop profiling end the profiling session When profiling you have nothing to do : - Let is run for standalone app (Console, Test, ..) - Navigate between pages/forms (Web Site or Desktop)
  • 14. 1 - Hot Path branch of your application's call tree that was most active when data was collected 2 - Functions Doing the Most Individual Work. functions with the highest exclusive samples 3 - Summary Timeline timeline graph & CPU usage 4 - Error List uses a set of rules to suggest ways of improving the profiling run and to identify possible performance problems 14 Summary View Summary depends on Profiling method !
  • 15. There are also a few others Views of profiling data files are displayed • Call Tree • Modules View • Functions View • Object Lifetime View • Thread Details View • Tier Interaction Views • … 15 Analysis Results
  • 17. 17 Demo #1 ASP.NET MVC 4 Sample (Magazine website) Many Samples in Dal code and many calls to the db. Missing cache ?
  • 18. 18 Demo #2 Micro Benchmarking a Translation Helper (in Unit Test) More than 93% of elapsed time is spent on Regex.Replace … For sure, there is something to improve in the helper.
  • 19. 19 Demo #3 Task cancellation Helper For 100 000 tests, 300 000 tasks were allocated. Ouh ! For sure, memory consumption is not optimal when task is already completed.
  • 20. • Profiling data can be collected through the ASP.NET profiler when we run a web or a load test – Limited to sampling and tier interaction data – Not appropriate for long runs (profiler file can become large …) • Really powerful if you have real scenarios & test cases 20 Profiling ASP.NET Web & Load Tests You just have to select ASP.NET profiler for your test settings
  • 21. • Instrumentation profiling can provide a greater level of detail ; this means that more data is collected and instrumentation is more likely to impact the performance • The Visual Studio profiler provides an API for controlling data collection from within an application – allow us to limit the amount of data that is collected during a profiling session. Simply add a reference to ToolsMicrosoft.VisualStudio.Profiler.dll (VSDirToolsPerformance Tools) 21 Profiler APIs
  • 22. Right-click a test and choose Profile Test to run performance analysis on a single unit test 22 Profiling Unit Tests Since VS 2012 update 2 The test runs as usual followed by the analysis (sampling method). When analysis completes, you’ll see the classic summary view
  • 24. • http://msdn.microsoft.com/en-us/library/ms182372.aspx • http://msdn.microsoft.com/en-us/library/z9z62c29.aspx • http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation- profiling-with-visual-studio-2012.aspx • http://blogs.msdn.com/b/anilchandra/archive/2012/09/24/test.aspx • http://blogs.msdn.com/b/visualstudioalm/archive/tags/diagnostics/ • http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation- profiling-with-visual-studio-2012.aspx 24 Appendices & References
  • 25. Find out more • On https://techblog.betclicgroup.com/
  • 26. About Betclic • Betclic Everest Group, one of the world leaders in online gaming, has a unique portfolio comprising various complementary international brands: Betclic, Everest Gaming, bet-at-home.com, Expekt… • Active in 100 countries with more than 12 million customers worldwide, the Group is committed to promoting secure and responsible gaming and is a member of several international professional associations including the EGBA (European Gaming and Betting Association) and the ESSA (European Sports Security Association). • Through our brands, Betclic Everest Group places expertise, technological know-how and security at the heart of our strategy to deliver an on-line gaming offer attuned to the passion of our players.