Performance Tuning and Optimization Tools and Methods - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Performance Tuning and Optimization Tools and Methods

Description:

Intel's Vtune. Rational Quantify Software. Measurement. Metrics ... Intel's VTune Performance Analyzer. http://developer.intel.com/software/products/vtune/index.htm ... – PowerPoint PPT presentation

Number of Views:152
Avg rating:3.0/5.0
Slides: 23
Provided by: lisab93
Category:

less

Transcript and Presenter's Notes

Title: Performance Tuning and Optimization Tools and Methods


1
Performance Tuning and Optimization Tools and
Methods
  • CSSE 514Programming Methods
  • Presented May 22, 2001
  • By Team 1
  • Paul Murray, Lisa Black, Mike Rodgers, Marie
    Murray

2
Agenda
  • More Optimization
  • Techniques Lisa
  • Caching
  • Pooling
  • Parallelization (1) (2)
  • Measurement-Mike
  • Benchmarks
  • Tools
  • Example-Marie
  • The Reference Model-Paul
  • Performance Defined
  • Gon Fishing
  • The Life Cycle
  • Low Hanging Fruit and Plown It Under
  • Infrastructure Component Interactions (1) (2)

3
The Reference ModelPerformance Defined
  • Performance refers to the responsiveness of the
    system the time required to respond to stimuli
    (events) or the number of events processed in
    some interval of time.
  • Bass, Clements Kazman
  • Software Architecture in Practice
  • Measuring software performance is done relative
    to a specific set programmatic interfaces using a
    specific set of inputs and targeting a specific
    set of outputs.
  • The final performance measurement is the result
    of accumulated performance cost contributions of
    each hardware and software module involved in the
    production of the output(s) along the critical
    path.

4
The Reference Model Gon Fishing
5
The Life CycleLow Hanging Fruit and Plown
It Under
Estimate Future Response Time by using
appropriately sized test data (workload) with
healthy scaling margin.
Prioritization should balance performance
gain, client development needs, cost and timing
of complete re-write.
Instrument code and configure tools to isolate
potential performance culprit.
Avoid code rot by preemptive re-writes
Review infrastructure API evolution
6
Infrastructure Component Interactions (1)
  • Review application code interaction with
    infrastructure components
  • Example - configuring DBMS client interfaces
  • Trust no one! Isolate all interaction points and
    check
  • Client component versions
  • Other sources for components
  • Appropriate query scopes?
  • Appropriate transaction scopes?
  • Appropriate caching policies?

7
Infrastructure Component Interactions (2) Example
Application
ActiveX Data Objects
ODE-DB Provider for ODBC
Oracle Objects for OLE
ODBC Driver for Oracle
Oracle Call Interface
Network Interface
8
More Optimization Techniques
  • Class material covered improvements to
    application algorithms and code structure.
  • Additional techniques may include
  • Application level data caching
  • Application level object pooling
  • Application level multi-threading

9
Caching
  • Definition Storing frequently used application
    specific data where it can be quickly accessed
    (e.g. in memory).
  • Refreshing the cache one of the most difficult
    issues to resolve to use caching effectively
  • Client/Server Database Example
  • Pre-fetch database data and store it in a
    location with faster access, often a feature of
    client library components.
  • World Wide Web Example
  • Client side (browser) storage of most recently
    accessed web pages for rapid re-access in
    page-back operation / revising sites.

10
Pooling
  • Graphical Image Pools Pre-rendered, complex
    graphical images which may be reused through out
    the User Interface.
  • Connection Thread Pools - create a pool of
    threads when the server launches, store incoming
    connections in a queue, and have the threads in
    the pool progressively remove connections from
    the queue and process them.
  • Example Connection Pool JDBC DBConnectionPool
    Class
  • get an open connection from the pool,
  • return a connection to the pool,
  • release all resources and close all connections
    at shutdown
  • handles connection failures, such as time-outs
  • limit the number of connections in the pool to a
    predefined max value.

11
Parallelization (1)
  • Advantages
  • Single Processor Platform increased
    availability
  • Multiple Processor Platform increased
    throughput
  • Implementations
  • Multi-threading multiple light weight threads
  • Multi-processing multiple heavy weight threads
  • For Multiple Processors
  • Amdahls Law The performance that can be gained
    by parallel processing is limited by the amount
    of time that must be sequential
  • Used to determine ROI(return on investment) for
    changes
  • Speed-up 1/Sequential Processing Time

12
Parallelization (2) Gotchas
  • Startup Cost Try to create a thread pool at the
    start of the program, since thread creation is
    expensive and can outweigh the threading
    advantages.
  • Synchronous Access Cost Try to avoid situations
    where many threads must often access shared data
    sequentially.
  • Race Conditions Anomalous behavior due to
    unexpected critical dependence on the relative
    timing of events.
  • Dead Locks A situation where two or more threads
    are unable to proceed because each is waiting for
    one of the others to do something.

13
Benchmarking
  • Define your workload
  • Measurable
  • Reproducible
  • Representative of the whole system
  • Pick the right tools
  • Sampling
  • Instrumentation

14
Benchmarking Sampling
  • Work at the system level
  • Monitor the entire system
  • Only valid over time and with a measurable
    workload
  • Examples
  • Time-based, Event Based
  • Microsoft Performance Monitor

15
Benchmarking Instrumentation
  • Modify the application
  • Insert code to count performance data
  • Do not change execution flow
  • Do change timing of events
  • Increase the code size
  • Examples
  • Intels Vtune
  • Rational Quantify Software

16
Measurement Metrics
  • Know what you are trying to measure and select
    appropriate metrics and tools
  • Total elapsed time
  • Number of transactions per minute
  • Number of supported users
  • Where most time is spent in application
    (profiling)

17
Benchmarking Caveats
  • Number of ways to alter the results
  • The blatant cheat
  • Targeted optimization
  • Flag fiascos
  • Bait and switch
  • Bending the rules
  • Rigging the game
  • Benchmarks run by someone else should be suspect
  • The best benchmark is always your own application
  • Licensing agreements can prohibit public
    disclosure of results

18
Tools Benchmarking/Performance Monitoring (1)
 
19
Tools Benchmarking/Performance Monitoring (2)
20
Example ToolIntels VTune Performance Analyzer
  • http//developer.intel.com/software/products/vtune
    /index.htm
  • Cost --524
  • Functionality
  • Time and event-based system-wide sampling
  • C/C, Java, Fortran
  • Call Graph
  • how many times a function called another
  • how much time
  • Static Code Analysis
  • analysis of each block without executing
  • estimate of performance
  • creates a database of results
  • code coach to help optimize code (algorithms,
    processor instructions)
  • Hot Spot Analysis

21
Intel Vtune Performance Analyser
22
Intel Vtune Performance Analyser
Write a Comment
User Comments (0)
About PowerShow.com