SlideShare a Scribd company logo
1 of 16
Download to read offline
Agenda

• Why Performance Matters
• How You Can Improve Performance




                                    3
Why Performance Matters

• Attractive to users

• Looks more professional

• Help you get things done more efficiently

• Keeps the flow




                                              4
Why Performance Matters
• An example explains more than a thousand words




                                                   5
Why Performance Matters

• Performance is more important than ever before
   – Dynamic user interfaces

• Qt Everywhere
  – Desktop
  – Embedded platforms with limited hardware

• We cannot just buy better hardware anymore

• Clock speed vs. number of cores



                                                   6
Why Performance Matters

• Not all applications can take advantage of
  multiple cores

• And some will actually run slower:
   – Each core in the processor is slower

   – Most applications not programmed to be multi-
     threaded

• Multi-core crisis?


                                                     7
Agenda

• Why Performance Matters
• How You Can Improve Performance




                                    19
How You Can Improve Performance
• Theory of Constraints (TOC) by Eliyahu M. Goldratt
• The theory is based on the idea that in any complex
  system, there is usually one aspect of that system that
  limits its ability to achieve its goal or optimal
  functioning. To achieve any significant improvement of
  the system, the constraint must be identified and
  resolved.

• Applications will perform as fast as their bottlenecks




                                                            20
Theory of Constraints
• Define a goal:
   – For example: This application must run at 30 FPS

• Then:
   1) Identify the constraint
   2) Decide how to exploit the constraint
   3) Improve
   4) If goal not reached, go back to 1)
   5) Done




                                                        21
Identifying hot spots (1)
• The number one and most important task

• Make sure you have plausible data

• Don't randomly start looking for slow code paths!
   – An O(n2) algorithm isn't necessarily bad
   – Don't spend time on making it O(n log n) just for fun

• Don't spend time on optimizing bubble sort




                                                             22
Identifying hot spots (1)
                      • “Bottlenecks occur in
                        surprising places, so
                        don't try second guess
                        and put in a speed hack
                        until you have proven
                        that is where the
                        bottleneck is” -- Rob Pike



                                                     23
Identifying hot spots (1)
• The right approach for identifying hot spots:

   – Any profiler suitable for your platform
      • Shark (Mac OSX)
      • Valgrind (X11)
      • Visual Studio Profiler (Windows)
      • Embedded Trace Macrocell (ETM) (ARM devices)
• NB! Always profile in release mode




                                                       24
Identifying hot spots (1)
• Run application: “valgrind --tool=callgrind ./application”

• This will collect data and information about the program

• Data saved to file: callgrind.out.<pid>

• Beware:
   – I/O costs won't show up
   – Cache misses (--simulate-cache=yes)
• The next step is to analyze the data/profile
• Example



                                                               25
Identifying hot spots (1)
• Profiling a section of code (run with “–instr-atstart=no”):


              #include<BbrValgrind/callgrind.h>

              int myFunction() const
              {
                 CALLGRIND_START_INSTRUMENTATION;

                  int number = 10;
                  ...

                  CALLGRIND_STOP_INSTRUMENTATION;
                  CALLGRIND_DUMP_STATS;

                  return number;
              }



                                                                26
Identifying hot spots (1)
• When a hot-spot is identified:
  – Look at the code and ask yourself: Is this the right
    algorithm for this task?

• Once the best algorithm is selected, you can exploit the
  constraint




                                                             27
How to exploit the constraint (2)
• Optimize
   – Design level
   – Source code level
   – Compile level

• Optimization trade-offs:
   – Memory consumption, cache misses
   – Code clarity and conciseness




                                        28
Theory of Constraints
• Define a goal:
   – For example: This application must run at 30 FPS

• Then:
   1) Identify the constraint
   2) Decide how to exploit the constraint
   3) Improve
   4) If goal not reached, go back to 1)
   5) Done




                                                        65

More Related Content

What's hot

OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOSICS
 
Animation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIsAnimation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIsaccount inactive
 
Qt for beginners part 1 overview and key concepts
Qt for beginners part 1   overview and key conceptsQt for beginners part 1   overview and key concepts
Qt for beginners part 1 overview and key conceptsICS
 
Qt State Machine Framework
Qt State Machine FrameworkQt State Machine Framework
Qt State Machine Frameworkaccount inactive
 
Qt for beginners part 5 ask the experts
Qt for beginners part 5   ask the expertsQt for beginners part 5   ask the experts
Qt for beginners part 5 ask the expertsICS
 
Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Johan Thelin
 
Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicICS
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Jakarta_EE
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with QtICS
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt InternationalizationICS
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing moreICS
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKitAriya Hidayat
 
So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?Janel Heilbrunn
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Anne Nicolas
 
Testing Java Microservices: From Development to Production
Testing Java Microservices: From Development to ProductionTesting Java Microservices: From Development to Production
Testing Java Microservices: From Development to ProductionDaniel Bryant
 

What's hot (20)

Qt Programming on TI Processors
Qt Programming on TI ProcessorsQt Programming on TI Processors
Qt Programming on TI Processors
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 
Animation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIsAnimation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIs
 
Qt for beginners part 1 overview and key concepts
Qt for beginners part 1   overview and key conceptsQt for beginners part 1   overview and key concepts
Qt for beginners part 1 overview and key concepts
 
Qt State Machine Framework
Qt State Machine FrameworkQt State Machine Framework
Qt State Machine Framework
 
Qt for beginners part 5 ask the experts
Qt for beginners part 5   ask the expertsQt for beginners part 5   ask the experts
Qt for beginners part 5 ask the experts
 
Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011
 
Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business Logic
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
 
Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
 
So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?
 
Cross Platform Qt
Cross Platform QtCross Platform Qt
Cross Platform Qt
 
了解 Qt
了解 Qt了解 Qt
了解 Qt
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
 
Testing Java Microservices: From Development to Production
Testing Java Microservices: From Development to ProductionTesting Java Microservices: From Development to Production
Testing Java Microservices: From Development to Production
 

Similar to Improve Performance Using TOC

NBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then iceNBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then iceAlexandre Moneger
 
CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...
CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...
CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...Juraj Martinka
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tipsBill Buchan
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelDaniel Coupal
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering PrinciplesXu Jiang
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...Edge AI and Vision Alliance
 
Tooling for the JavaScript Era
Tooling for the JavaScript EraTooling for the JavaScript Era
Tooling for the JavaScript Eramartinlippert
 
Mapping Detection Coverage
Mapping Detection CoverageMapping Detection Coverage
Mapping Detection CoverageJared Atkinson
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6Gary Bisson
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningjClarity
 
TDD: seriously, try it! 
TDD: seriously, try it! TDD: seriously, try it! 
TDD: seriously, try it! Nacho Cougil
 
Peddle the Pedal to the Metal
Peddle the Pedal to the MetalPeddle the Pedal to the Metal
Peddle the Pedal to the MetalC4Media
 
Test Driven Design by Jonas Auken
Test Driven Design by Jonas AukenTest Driven Design by Jonas Auken
Test Driven Design by Jonas Aukenagilencr
 
Why Kubernetes Freedom Requires Chaos Engineering to Shine in Production
Why Kubernetes Freedom Requires Chaos Engineering to Shine in ProductionWhy Kubernetes Freedom Requires Chaos Engineering to Shine in Production
Why Kubernetes Freedom Requires Chaos Engineering to Shine in ProductionScyllaDB
 

Similar to Improve Performance Using TOC (20)

Anti patterns part 2
Anti patterns part 2Anti patterns part 2
Anti patterns part 2
 
NBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then iceNBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then ice
 
03 performance
03 performance03 performance
03 performance
 
Software maintenance PyConPL 2016
Software maintenance PyConPL 2016Software maintenance PyConPL 2016
Software maintenance PyConPL 2016
 
CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...
CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...
CodeScene: Get Deep Insights into Your (Clojure) Code [Clojure Vienna meetup ...
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tips
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering Principles
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
 
Tooling for the JavaScript Era
Tooling for the JavaScript EraTooling for the JavaScript Era
Tooling for the JavaScript Era
 
Anti patterns part 2
Anti patterns part 2Anti patterns part 2
Anti patterns part 2
 
Mapping Detection Coverage
Mapping Detection CoverageMapping Detection Coverage
Mapping Detection Coverage
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
TDD: seriously, try it! 
TDD: seriously, try it! TDD: seriously, try it! 
TDD: seriously, try it! 
 
Peddle the Pedal to the Metal
Peddle the Pedal to the MetalPeddle the Pedal to the Metal
Peddle the Pedal to the Metal
 
JavaFX 101
JavaFX 101JavaFX 101
JavaFX 101
 
04 performance
04 performance04 performance
04 performance
 
Test Driven Design by Jonas Auken
Test Driven Design by Jonas AukenTest Driven Design by Jonas Auken
Test Driven Design by Jonas Auken
 
Why Kubernetes Freedom Requires Chaos Engineering to Shine in Production
Why Kubernetes Freedom Requires Chaos Engineering to Shine in ProductionWhy Kubernetes Freedom Requires Chaos Engineering to Shine in Production
Why Kubernetes Freedom Requires Chaos Engineering to Shine in Production
 

More from Develer S.r.l.

Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linuxTrace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linuxDeveler S.r.l.
 
Cloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopCloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopDeveler S.r.l.
 
Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel HackingDeveler S.r.l.
 
BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011Develer S.r.l.
 
Qt roadmap: the future of Qt
Qt roadmap: the future of QtQt roadmap: the future of Qt
Qt roadmap: the future of QtDeveler S.r.l.
 
Qt Quick for dynamic UI development
Qt Quick for dynamic UI developmentQt Quick for dynamic UI development
Qt Quick for dynamic UI developmentDeveler S.r.l.
 
Qt licensing: making the right choice
Qt licensing: making the right choiceQt licensing: making the right choice
Qt licensing: making the right choiceDeveler S.r.l.
 
Qt everywhere a c++ abstraction platform
Qt everywhere   a c++ abstraction platformQt everywhere   a c++ abstraction platform
Qt everywhere a c++ abstraction platformDeveler S.r.l.
 
Qt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmerQt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmerDeveler S.r.l.
 
PyQt: rapid application development
PyQt: rapid application developmentPyQt: rapid application development
PyQt: rapid application developmentDeveler S.r.l.
 
Hybrid development using Qt webkit
Hybrid development using Qt webkitHybrid development using Qt webkit
Hybrid development using Qt webkitDeveler S.r.l.
 
Crossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n systemCrossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n systemDeveler S.r.l.
 
BeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded FreeBeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded FreeDeveler S.r.l.
 
BeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOSBeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOSDeveler S.r.l.
 
Develer - Company Profile
Develer - Company ProfileDeveler - Company Profile
Develer - Company ProfileDeveler S.r.l.
 
Bettersoftware Feedback 2009
Bettersoftware Feedback 2009Bettersoftware Feedback 2009
Bettersoftware Feedback 2009Develer S.r.l.
 

More from Develer S.r.l. (20)

Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linuxTrace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
 
Sw libero rf
Sw libero rfSw libero rf
Sw libero rf
 
Engagement small
Engagement smallEngagement small
Engagement small
 
Farepipi
FarepipiFarepipi
Farepipi
 
Cloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopCloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshop
 
Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel Hacking
 
BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011
 
Qt roadmap: the future of Qt
Qt roadmap: the future of QtQt roadmap: the future of Qt
Qt roadmap: the future of Qt
 
Qt Quick in depth
Qt Quick in depthQt Quick in depth
Qt Quick in depth
 
Qt Quick for dynamic UI development
Qt Quick for dynamic UI developmentQt Quick for dynamic UI development
Qt Quick for dynamic UI development
 
Qt licensing: making the right choice
Qt licensing: making the right choiceQt licensing: making the right choice
Qt licensing: making the right choice
 
Qt everywhere a c++ abstraction platform
Qt everywhere   a c++ abstraction platformQt everywhere   a c++ abstraction platform
Qt everywhere a c++ abstraction platform
 
Qt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmerQt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmer
 
PyQt: rapid application development
PyQt: rapid application developmentPyQt: rapid application development
PyQt: rapid application development
 
Hybrid development using Qt webkit
Hybrid development using Qt webkitHybrid development using Qt webkit
Hybrid development using Qt webkit
 
Crossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n systemCrossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n system
 
BeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded FreeBeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded Free
 
BeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOSBeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOS
 
Develer - Company Profile
Develer - Company ProfileDeveler - Company Profile
Develer - Company Profile
 
Bettersoftware Feedback 2009
Bettersoftware Feedback 2009Bettersoftware Feedback 2009
Bettersoftware Feedback 2009
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Improve Performance Using TOC

  • 1. Agenda • Why Performance Matters • How You Can Improve Performance 3
  • 2. Why Performance Matters • Attractive to users • Looks more professional • Help you get things done more efficiently • Keeps the flow 4
  • 3. Why Performance Matters • An example explains more than a thousand words 5
  • 4. Why Performance Matters • Performance is more important than ever before – Dynamic user interfaces • Qt Everywhere – Desktop – Embedded platforms with limited hardware • We cannot just buy better hardware anymore • Clock speed vs. number of cores 6
  • 5. Why Performance Matters • Not all applications can take advantage of multiple cores • And some will actually run slower: – Each core in the processor is slower – Most applications not programmed to be multi- threaded • Multi-core crisis? 7
  • 6. Agenda • Why Performance Matters • How You Can Improve Performance 19
  • 7. How You Can Improve Performance • Theory of Constraints (TOC) by Eliyahu M. Goldratt • The theory is based on the idea that in any complex system, there is usually one aspect of that system that limits its ability to achieve its goal or optimal functioning. To achieve any significant improvement of the system, the constraint must be identified and resolved. • Applications will perform as fast as their bottlenecks 20
  • 8. Theory of Constraints • Define a goal: – For example: This application must run at 30 FPS • Then: 1) Identify the constraint 2) Decide how to exploit the constraint 3) Improve 4) If goal not reached, go back to 1) 5) Done 21
  • 9. Identifying hot spots (1) • The number one and most important task • Make sure you have plausible data • Don't randomly start looking for slow code paths! – An O(n2) algorithm isn't necessarily bad – Don't spend time on making it O(n log n) just for fun • Don't spend time on optimizing bubble sort 22
  • 10. Identifying hot spots (1) • “Bottlenecks occur in surprising places, so don't try second guess and put in a speed hack until you have proven that is where the bottleneck is” -- Rob Pike 23
  • 11. Identifying hot spots (1) • The right approach for identifying hot spots: – Any profiler suitable for your platform • Shark (Mac OSX) • Valgrind (X11) • Visual Studio Profiler (Windows) • Embedded Trace Macrocell (ETM) (ARM devices) • NB! Always profile in release mode 24
  • 12. Identifying hot spots (1) • Run application: “valgrind --tool=callgrind ./application” • This will collect data and information about the program • Data saved to file: callgrind.out.<pid> • Beware: – I/O costs won't show up – Cache misses (--simulate-cache=yes) • The next step is to analyze the data/profile • Example 25
  • 13. Identifying hot spots (1) • Profiling a section of code (run with “–instr-atstart=no”): #include<BbrValgrind/callgrind.h> int myFunction() const { CALLGRIND_START_INSTRUMENTATION; int number = 10; ... CALLGRIND_STOP_INSTRUMENTATION; CALLGRIND_DUMP_STATS; return number; } 26
  • 14. Identifying hot spots (1) • When a hot-spot is identified: – Look at the code and ask yourself: Is this the right algorithm for this task? • Once the best algorithm is selected, you can exploit the constraint 27
  • 15. How to exploit the constraint (2) • Optimize – Design level – Source code level – Compile level • Optimization trade-offs: – Memory consumption, cache misses – Code clarity and conciseness 28
  • 16. Theory of Constraints • Define a goal: – For example: This application must run at 30 FPS • Then: 1) Identify the constraint 2) Decide how to exploit the constraint 3) Improve 4) If goal not reached, go back to 1) 5) Done 65