SlideShare a Scribd company logo
1 of 16
Analytics tools and
Instruments
Krunal S.Soni, 14th April 2014
Static Analyzer
First Line of defense
Static Analyzer
 First line of defense
 Built-in based on open source Clang Static Analyzer
 Finds bug in C and Objective-C programs
 Works like a compiler looking for logic flaws and instances where best coding
practices are not followed
 Good for cutting down unused variables and Other small memory management
issues.
Static Analyzer - Options
1. By default, Xcode uses the version of clang that came bundled with it to analyze
code
2. Open Source Analyzer builds
Open Source Builds - Advantages
 Newer than the analyzer provided
 Contains bug fixes
 New Checks
 Better analysis
Static Analyzer – Command Line Utility
• set-xcode-analyzer
It allows the user to change what copy of clang that Xcode uses for analysis
Terminal :
$ set-xcode-analyzer -h
Usage: set-xcode-analyzer [options]
Options:
-h, --help show this help message and exit
--use-checker-build=PATH
Use the Clang located at the provided absolute path,
e.g. /Users/foo/checker-1
--use-xcode-clang Use the Clang bundled with Xcode
Modes of set-xcode-analyzer
• --use-xcode-clang
Switch to Xcode to using the clang that came bundled with it for static analysis
• --use-checker-build
Switch Xcode to using the clang provided by the specified analyzer build
Things to keep Mind :
1. We should quit Xcode prior to running set-xcode-analyzer
2. We need to run set-xcode-analyzer in sudo in order to have write privileges to modify Xcode
configuration files
Examples
1. Example 1:
Telling Xcode to use a very specific version of clang
Terminal :
$ sudo set-xcode-analyzer --use-checker-build=~/mycrazyclangbuild/bin/clang
2. Example 2:
Telling Xcode to use its default clang analyzer
Terminal :
$ sudo set-xcode-analyzer --use-xcode-clang
Instruments
Second Line of defense – Bug Hunting in Simulator
Types of Memory Leaks
• True Memory Leak : It is where object has not yet been de-allocated but no longer
referenced by anything. Therefore the memory can never be re-used.
• Unbounded Memory growth : It happens where memory continues to be allocated
and never ever given a chance to be de-allocated.
Different Instruments
• Allocations
 It used to take snapshot of the heap as apps perform its tasks
 For unbounded memory growth kind of situations , allocations instrument is to be used.
Test Case : Do something in the app and then undo that something , returning the state of the app to its
prior point . If the memory allocated in the heap is still the same , no worries. It’s simple and repeatable
test scenario of performing the task and returning the app to its state prior to performing the task.
• Leaks
 For true memory leak kind of situtations , the leaks instruments is used.
Test Case : The most common situation where this occurs is with buried or overly complex logic that’s
supposed to release memory, but under certain circumstances doesn’t get executed. These memory
leaks can lead to the app crashing or being shut down. If an app is holding on to too much memory
when the user decides to suspend the app, the watchdog may have no choice but to quit the app in
order to free memory. By keeping a lean application, the chances of this happening are minimized.
• Time Profiler
 Premature optimization i.e spending time optimizing the bits of code that rarely don’t matter in the end,
issues are tackled by time profiler.
 Apple recommends developers try to perform time measurements on the slowest supported device
 It allows developers to prioritize which bit of logic needs to be refactored prior to release. Some things may
not be fixable, but it’s possible other factors could be reviewed in order to see if there’s a better way to
address the issue at hand, possibly by moving logic off the main thread using Blocks and Grand Central
Dispatch
Pick What you Want
Goto Product -> Profile, we are presented with plate full of options
Terminologies
Separate by Thread: Each thread should be considered separately. This enables you to understand
which threads are responsible for the greatest amount of CPU use.
Invert Call Tree: With this option, the stack trace is considered from top to bottom. This means that
you will see the methods in the table that would have been in frame 0 when the sample was taken.
This is usually what you want, as you want to see the deepest methods where the CPU is spending
its time.
Hide Missing Symbols: If the dSYM file cannot be found for your app or a system framework, then
instead of seeing method names (symbols) in the table, you’ll just see hex values. These correspond
to the address of the instruction within the binary code. If this option is selected, then these are
hidden, and only fully resolved symbols are displayed. This helps to declutter the data presented.
Hide System Libraries: When this option is selected, only symbols from your own app are displayed.
It’s often useful to select this option, since usually you only care about where the CPU is spending
time in your own code – you can’t do much about how much CPU the system libraries are using!
Show Obj-C Only: If this is selected, then only Objective-C methods are displayed, rather than any C
or C++ functions. There are none in your program, but if you were looking at an OpenGL app, it
might have some C++, for example.
Flatten Recursion: This option treats recursive functions (ones which call themselves) as one entry in
each stack trace, rather than multiple.
Top Functions: Enabling this makes Instruments consider the total time spent in a function as the
sum of the time directly within that function, as well as the time spent in functions called by that
function. So if function A calls B, then A’s time is reported as the time spent in A PLUS the time spent
in B. This can be really useful, as it lets you pick the largest time figure each time you descend into
the call stack, zeroing in on your most time-consuming methods.
Thank You

More Related Content

What's hot

Basics of QTP Framework
Basics of QTP FrameworkBasics of QTP Framework
Basics of QTP FrameworkAnish10110
 
Basic buffer overflow part1
Basic buffer overflow part1Basic buffer overflow part1
Basic buffer overflow part1Payampardaz
 
Application of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data AnalysisApplication of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data AnalysisChrisCoughlin9
 
Pro smartbooksquestions
Pro smartbooksquestionsPro smartbooksquestions
Pro smartbooksquestionsyoummr
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system softwaregayathri ravi
 
Debugging and optimization of multi-thread OpenMP-programs
Debugging and optimization of multi-thread OpenMP-programsDebugging and optimization of multi-thread OpenMP-programs
Debugging and optimization of multi-thread OpenMP-programsPVS-Studio
 
Unit testing with NUnit
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnitkleinron
 
Parallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterParallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterSudhang Shankar
 
Measurement .Net Performance with BenchmarkDotNet
Measurement .Net Performance with BenchmarkDotNetMeasurement .Net Performance with BenchmarkDotNet
Measurement .Net Performance with BenchmarkDotNetVasyl Senko
 
One function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO ProjectOne function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO ProjectNay Oo Kyaw
 
Automated Testing of Hybrid Simulink/Stateflow Controllers
Automated Testing of Hybrid Simulink/Stateflow ControllersAutomated Testing of Hybrid Simulink/Stateflow Controllers
Automated Testing of Hybrid Simulink/Stateflow ControllersLionel Briand
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblySam Bowne
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professionalsunny.deb
 
Addmi 11-intro to-patterns
Addmi 11-intro to-patternsAddmi 11-intro to-patterns
Addmi 11-intro to-patternsodanyboy
 
Bootstrapping in Compiler
Bootstrapping in CompilerBootstrapping in Compiler
Bootstrapping in CompilerAkhil Kaushik
 

What's hot (20)

Qtp 101
Qtp 101Qtp 101
Qtp 101
 
Basics of QTP Framework
Basics of QTP FrameworkBasics of QTP Framework
Basics of QTP Framework
 
Basic buffer overflow part1
Basic buffer overflow part1Basic buffer overflow part1
Basic buffer overflow part1
 
Application of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data AnalysisApplication of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data Analysis
 
Pro smartbooksquestions
Pro smartbooksquestionsPro smartbooksquestions
Pro smartbooksquestions
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system software
 
Debugging and optimization of multi-thread OpenMP-programs
Debugging and optimization of multi-thread OpenMP-programsDebugging and optimization of multi-thread OpenMP-programs
Debugging and optimization of multi-thread OpenMP-programs
 
Unit testing with NUnit
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnit
 
Parallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterParallel Programming on the ANDC cluster
Parallel Programming on the ANDC cluster
 
Measurement .Net Performance with BenchmarkDotNet
Measurement .Net Performance with BenchmarkDotNetMeasurement .Net Performance with BenchmarkDotNet
Measurement .Net Performance with BenchmarkDotNet
 
One function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO ProjectOne function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO Project
 
N Unit Presentation
N Unit PresentationN Unit Presentation
N Unit Presentation
 
Java Profiling
Java ProfilingJava Profiling
Java Profiling
 
Automated Testing of Hybrid Simulink/Stateflow Controllers
Automated Testing of Hybrid Simulink/Stateflow ControllersAutomated Testing of Hybrid Simulink/Stateflow Controllers
Automated Testing of Hybrid Simulink/Stateflow Controllers
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 Disassembly
 
Ss debuggers
Ss debuggersSs debuggers
Ss debuggers
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professional
 
Addmi 11-intro to-patterns
Addmi 11-intro to-patternsAddmi 11-intro to-patterns
Addmi 11-intro to-patterns
 
Basic input-output-v.1.1
Basic input-output-v.1.1Basic input-output-v.1.1
Basic input-output-v.1.1
 
Bootstrapping in Compiler
Bootstrapping in CompilerBootstrapping in Compiler
Bootstrapping in Compiler
 

Viewers also liked

HPM PRESE. FINALI 21-06-05
HPM PRESE. FINALI 21-06-05HPM PRESE. FINALI 21-06-05
HPM PRESE. FINALI 21-06-05vijay gopani
 
Slovak Startups Report 2016 - Part of V4 Startup Survey (1)
Slovak Startups Report 2016 - Part of V4 Startup Survey (1)Slovak Startups Report 2016 - Part of V4 Startup Survey (1)
Slovak Startups Report 2016 - Part of V4 Startup Survey (1)Petra Dzurovcinova
 
для уроків з іст. рідн.краюдуховні джерела мого народу
для уроків з іст. рідн.краюдуховні джерела мого народудля уроків з іст. рідн.краюдуховні джерела мого народу
для уроків з іст. рідн.краюдуховні джерела мого народуmiliutenkolena2015
 
до виховного заходу роль жінки
до виховного заходу роль жінкидо виховного заходу роль жінки
до виховного заходу роль жінкиmiliutenkolena2015
 
מאבקי התקשורת והאמון הציבורי
מאבקי התקשורת והאמון הציבורימאבקי התקשורת והאמון הציבורי
מאבקי התקשורת והאמון הציבוריIFAT GROUP
 
Bagian depan
Bagian depanBagian depan
Bagian depanvilut nur
 
Gateway Entrep Case Study Individual Final (2) (1)
Gateway Entrep Case Study Individual Final (2) (1)Gateway Entrep Case Study Individual Final (2) (1)
Gateway Entrep Case Study Individual Final (2) (1)Robin Hoke
 

Viewers also liked (13)

Home_Sellers_Guide
Home_Sellers_GuideHome_Sellers_Guide
Home_Sellers_Guide
 
HPM PRESE. FINALI 21-06-05
HPM PRESE. FINALI 21-06-05HPM PRESE. FINALI 21-06-05
HPM PRESE. FINALI 21-06-05
 
Slovak Startups Report 2016 - Part of V4 Startup Survey (1)
Slovak Startups Report 2016 - Part of V4 Startup Survey (1)Slovak Startups Report 2016 - Part of V4 Startup Survey (1)
Slovak Startups Report 2016 - Part of V4 Startup Survey (1)
 
для уроків з іст. рідн.краюдуховні джерела мого народу
для уроків з іст. рідн.краюдуховні джерела мого народудля уроків з іст. рідн.краюдуховні джерела мого народу
для уроків з іст. рідн.краюдуховні джерела мого народу
 
до виховного заходу роль жінки
до виховного заходу роль жінкидо виховного заходу роль жінки
до виховного заходу роль жінки
 
Content-tastic Calender 2015
Content-tastic Calender 2015Content-tastic Calender 2015
Content-tastic Calender 2015
 
מאבקי התקשורת והאמון הציבורי
מאבקי התקשורת והאמון הציבורימאבקי התקשורת והאמון הציבורי
מאבקי התקשורת והאמון הציבורי
 
RPH TAHUN 1 M1
RPH TAHUN 1 M1RPH TAHUN 1 M1
RPH TAHUN 1 M1
 
Kristen Maragh Resume
Kristen Maragh ResumeKristen Maragh Resume
Kristen Maragh Resume
 
Our environment
Our environmentOur environment
Our environment
 
Bagian depan
Bagian depanBagian depan
Bagian depan
 
Gateway Entrep Case Study Individual Final (2) (1)
Gateway Entrep Case Study Individual Final (2) (1)Gateway Entrep Case Study Individual Final (2) (1)
Gateway Entrep Case Study Individual Final (2) (1)
 
Hollow Pipes (8)
Hollow Pipes (8)Hollow Pipes (8)
Hollow Pipes (8)
 

Similar to Analytics Tools and Instruments Guide

Arm developement
Arm developementArm developement
Arm developementhirokiht
 
MC0078 SMU 2013 Fall session
MC0078 SMU 2013 Fall sessionMC0078 SMU 2013 Fall session
MC0078 SMU 2013 Fall sessionNarinder Kumar
 
Analyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And IssuesAnalyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And IssuesGreg Sohl
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfNayanChandak1
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012Ashish Bhasin
 
Chelberg ptcuser 2010
Chelberg ptcuser 2010Chelberg ptcuser 2010
Chelberg ptcuser 2010Clay Helberg
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsNational Cheng Kung University
 
Lecture 3.1.1 Try Throw Catch.pptx
Lecture 3.1.1 Try Throw Catch.pptxLecture 3.1.1 Try Throw Catch.pptx
Lecture 3.1.1 Try Throw Catch.pptxsunilsoni446112
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineAnup Singh
 
Building of systems of automatic C/C++ code logging
Building of systems of automatic C/C++ code loggingBuilding of systems of automatic C/C++ code logging
Building of systems of automatic C/C++ code loggingPVS-Studio
 
RxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalRxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalSidereo
 
Monitor(karthika)
Monitor(karthika)Monitor(karthika)
Monitor(karthika)Nagarajan
 
Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Dr. Pankaj Agarwal
 
Lecture 1 Try Throw Catch.pptx
Lecture 1 Try Throw Catch.pptxLecture 1 Try Throw Catch.pptx
Lecture 1 Try Throw Catch.pptxVishuSaini22
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK toolsHaribabu Nandyal Padmanaban
 
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerPyData
 

Similar to Analytics Tools and Instruments Guide (20)

Arm developement
Arm developementArm developement
Arm developement
 
MC0078 SMU 2013 Fall session
MC0078 SMU 2013 Fall sessionMC0078 SMU 2013 Fall session
MC0078 SMU 2013 Fall session
 
Debugging
DebuggingDebugging
Debugging
 
Analyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And IssuesAnalyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And Issues
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012
 
Chelberg ptcuser 2010
Chelberg ptcuser 2010Chelberg ptcuser 2010
Chelberg ptcuser 2010
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
RAJAT PROJECT.pptx
RAJAT PROJECT.pptxRAJAT PROJECT.pptx
RAJAT PROJECT.pptx
 
Lecture 3.1.1 Try Throw Catch.pptx
Lecture 3.1.1 Try Throw Catch.pptxLecture 3.1.1 Try Throw Catch.pptx
Lecture 3.1.1 Try Throw Catch.pptx
 
Automation using ibm rft
Automation using ibm rftAutomation using ibm rft
Automation using ibm rft
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
 
Building of systems of automatic C/C++ code logging
Building of systems of automatic C/C++ code loggingBuilding of systems of automatic C/C++ code logging
Building of systems of automatic C/C++ code logging
 
RxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalRxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android Montréal
 
Monitor(karthika)
Monitor(karthika)Monitor(karthika)
Monitor(karthika)
 
Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis
 
Lecture 1 Try Throw Catch.pptx
Lecture 1 Try Throw Catch.pptxLecture 1 Try Throw Catch.pptx
Lecture 1 Try Throw Catch.pptx
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
 
Cppcheck
CppcheckCppcheck
Cppcheck
 
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
 

Analytics Tools and Instruments Guide

  • 1. Analytics tools and Instruments Krunal S.Soni, 14th April 2014
  • 3. Static Analyzer  First line of defense  Built-in based on open source Clang Static Analyzer  Finds bug in C and Objective-C programs  Works like a compiler looking for logic flaws and instances where best coding practices are not followed  Good for cutting down unused variables and Other small memory management issues.
  • 4. Static Analyzer - Options 1. By default, Xcode uses the version of clang that came bundled with it to analyze code 2. Open Source Analyzer builds
  • 5. Open Source Builds - Advantages  Newer than the analyzer provided  Contains bug fixes  New Checks  Better analysis
  • 6. Static Analyzer – Command Line Utility • set-xcode-analyzer It allows the user to change what copy of clang that Xcode uses for analysis Terminal : $ set-xcode-analyzer -h Usage: set-xcode-analyzer [options] Options: -h, --help show this help message and exit --use-checker-build=PATH Use the Clang located at the provided absolute path, e.g. /Users/foo/checker-1 --use-xcode-clang Use the Clang bundled with Xcode
  • 7. Modes of set-xcode-analyzer • --use-xcode-clang Switch to Xcode to using the clang that came bundled with it for static analysis • --use-checker-build Switch Xcode to using the clang provided by the specified analyzer build Things to keep Mind : 1. We should quit Xcode prior to running set-xcode-analyzer 2. We need to run set-xcode-analyzer in sudo in order to have write privileges to modify Xcode configuration files
  • 8. Examples 1. Example 1: Telling Xcode to use a very specific version of clang Terminal : $ sudo set-xcode-analyzer --use-checker-build=~/mycrazyclangbuild/bin/clang 2. Example 2: Telling Xcode to use its default clang analyzer Terminal : $ sudo set-xcode-analyzer --use-xcode-clang
  • 9. Instruments Second Line of defense – Bug Hunting in Simulator
  • 10. Types of Memory Leaks • True Memory Leak : It is where object has not yet been de-allocated but no longer referenced by anything. Therefore the memory can never be re-used. • Unbounded Memory growth : It happens where memory continues to be allocated and never ever given a chance to be de-allocated.
  • 11. Different Instruments • Allocations  It used to take snapshot of the heap as apps perform its tasks  For unbounded memory growth kind of situations , allocations instrument is to be used. Test Case : Do something in the app and then undo that something , returning the state of the app to its prior point . If the memory allocated in the heap is still the same , no worries. It’s simple and repeatable test scenario of performing the task and returning the app to its state prior to performing the task.
  • 12. • Leaks  For true memory leak kind of situtations , the leaks instruments is used. Test Case : The most common situation where this occurs is with buried or overly complex logic that’s supposed to release memory, but under certain circumstances doesn’t get executed. These memory leaks can lead to the app crashing or being shut down. If an app is holding on to too much memory when the user decides to suspend the app, the watchdog may have no choice but to quit the app in order to free memory. By keeping a lean application, the chances of this happening are minimized.
  • 13. • Time Profiler  Premature optimization i.e spending time optimizing the bits of code that rarely don’t matter in the end, issues are tackled by time profiler.  Apple recommends developers try to perform time measurements on the slowest supported device  It allows developers to prioritize which bit of logic needs to be refactored prior to release. Some things may not be fixable, but it’s possible other factors could be reviewed in order to see if there’s a better way to address the issue at hand, possibly by moving logic off the main thread using Blocks and Grand Central Dispatch
  • 14. Pick What you Want Goto Product -> Profile, we are presented with plate full of options
  • 15. Terminologies Separate by Thread: Each thread should be considered separately. This enables you to understand which threads are responsible for the greatest amount of CPU use. Invert Call Tree: With this option, the stack trace is considered from top to bottom. This means that you will see the methods in the table that would have been in frame 0 when the sample was taken. This is usually what you want, as you want to see the deepest methods where the CPU is spending its time. Hide Missing Symbols: If the dSYM file cannot be found for your app or a system framework, then instead of seeing method names (symbols) in the table, you’ll just see hex values. These correspond to the address of the instruction within the binary code. If this option is selected, then these are hidden, and only fully resolved symbols are displayed. This helps to declutter the data presented. Hide System Libraries: When this option is selected, only symbols from your own app are displayed. It’s often useful to select this option, since usually you only care about where the CPU is spending time in your own code – you can’t do much about how much CPU the system libraries are using! Show Obj-C Only: If this is selected, then only Objective-C methods are displayed, rather than any C or C++ functions. There are none in your program, but if you were looking at an OpenGL app, it might have some C++, for example. Flatten Recursion: This option treats recursive functions (ones which call themselves) as one entry in each stack trace, rather than multiple. Top Functions: Enabling this makes Instruments consider the total time spent in a function as the sum of the time directly within that function, as well as the time spent in functions called by that function. So if function A calls B, then A’s time is reported as the time spent in A PLUS the time spent in B. This can be really useful, as it lets you pick the largest time figure each time you descend into the call stack, zeroing in on your most time-consuming methods.