Вы находитесь на странице: 1из 35

ABAP Performance Analysis

Tools of the Trade SCI - Code Inspector

ST05 Performance Trace


SE30 ABAP Runtime Analysis

Tools of the Trade


SCI Code Inspector
Static analysis of the quality of the code. Scans your program code and reports on potential problems particularly in the area of performance and security.

Benefits:
Analysis of SQL WHERE clause of SELECT, UPDATE and DELETE statements. Identifies select statements that do not handle sy-subrc return codes Use of statements that infer ominous database access Identifies statements that bypass buffering Drill through support from results screen to program source statement. Etc.

Disadvantages:
Static checks cannot identify the relevancy of a piece of code Cannot determine the frequency of execution of a statement of code.

Tools of the Trade


ST05 Performance Trace
The Performance Trace allows you to record database access, locking activities, and remote calls of reports and transactions in a trace file and to display the performance log as a list. It also provides extensive support for analyzing individual trace records.

Benefits:
Comprehensive tools set for evaluation of SQL statements Integrated tools for accessing DDIC information

Disadvantages:
Dynamic analysis requires equivalent production data content Limited to database access analysis, no evaluation of code path execution

Tools of the Trade


SE30 ABAP Runtime Analysis
The runtime analysis provides an overview of the duration and performance of your source code, from individual statements up to complete transactions.

Benefits:
Quickly identifies the percentage of time spent in database in contrast to abap code execution. Evaluation of modularization units, modules, performs, functions, etc. Analyze internal table operations

Disadvantage:
Dynamic analysis requires equivalent production data content Lacks the integration of comprehensive SQL analysis tools

Code Inspector
Standard Checks Performed Syntax checks and program generation
Normal ABAP syntax check

Extended Program Check

Program Generation

Security checks
Use of statements deemed critical

Use of statements the infers ominous database access

Selected statements that do not handle system return code

Sophisticated static program checks should be part of each development process.

Code Inspector
Standard Checks Performed (continued) Performance checks
Select statements that implicitly bypass SAP table buffers

Check statements inside of SELETCTENDSELECT loops

Nested loops over internal tables and nested SELECT statements


Analysis of WHERE clause to determine support database indices

Search operations
Search for single tokens

Search for complete statements Sophisticated static program checks should be part of each development process.

Code Inspector
Access directly from the Abap Editor, from SE38 or SE80

Sophisticated static program checks should be part of each development process.

Code Inspector
Extended Performance Program Checks Checks Error Warnings Informational Errors: Errors: No Table EXCEPTION VEPO no field to set from SY-SUBRC Table Index in Declared WHERE for CALL condition FUNCTION.
Evaluate tothe remove sy-subrc condition or 1. Can format of where clause possibly warrants the review of the function be changed to use an index module for modification.

31

16

2. Create an index to support This line contains a BREAK-POINT where condition if warranted. statement. Warnings: All break points should be removed from
code unless specific reasons Tableproduction KNMT: No First Field from Table warrant their use. Index in WHERE condition Dangerous use of TRANSLATE in a Further analysis may be multilingual system. required to determine if this is a Evaluate to determine if this analysis will have an problem. Dynamic that impact when we implement other languages. determines frequency of execution can be used to determine impact of the warning.

Sophisticated static program checks should be part of each development process.

Performance Trace
Transaction ST05
Used to analyze and fine-tune programs database access Dynamic analysis Must be logged into processor where job is running that is subject to the trace. Should pre-load the application before trace is started. Should strive to use this trace in QA unless production problem cannot be recreated.

Types of traces available


SQL Trace Enqueue Trace RFC Trace Buffer Trace

Performance Trace
Activate Activate Trace Trace with Use to start the trace in your Filter
current dialog process. Used start the trace Once to activated you may exit against another process. the transaction and run the User name Useful to start program that you wish to a trace trace.another users dialog session. Transaction Further limits bounder of trace to a tcode. Process ID Used to activate trace against a batch process.

Performance Trace
Display Trace

Performance Trace

Performance Trace - SQL Statement Summary

Performance Trace - SQL Statement Evaluation Checklist


Is there any SELECT * statements in use?
Change them to SELECT COL1,COL2,COL3 specifying columns

Are any CHECK statements embedded in SELECT..ENDSELECTs


Incorporate the check statement logic in WHERE clause

Do SELECTs use appropriate DB Index or is table buffered?


Change logic, create an index, or buffer table

Is nested SELECTs being used to retrieve data?


Convert to DB join, view or SELECT FOR ALL ENTRIES IN ITAB

Are there SELECTs without WHERE clauses, on tables that grow?


You need to redesign the solution.

Are SELECTs to master data tables buffered?


Store master data in itab and use READ TABLEBINARY SEARCH to eliminate duplicate access with same key

Performance Trace - SQL Statement Evaluation Checklist


Is SELECTAPPEND ITABENDSELECT being used?
Change processing to read data immediately into ITAB

Is SELECT ORDER BY statements being used?


Read data to ITAB and then sort, unless DB Index supports order by.

Is program using calculations and summations that can be done on the database via SUM, AVG, MIN or MAX functions of SELECT?
Use the calculations available on the SELECT statement.

Are ITABs processed using READ TABLE itab WITH KEY?


Change table accesses to use BINARY SEARCH method.

Performance Trace
Tips for Running Trace
Limit the duration of the trace to 10 minutes or less Preload the program once to initialize database and cursor buffers To access trace results later
Save the trace or.. Record stop and start time of trace

Utilize trace SQL statement summary function 5,000ms access per execution, general rule of thumb Make note of the appserver of the job you are tracing Only ONE trace can be active on an appserver.

Runtime Analysis
Transaction SE30
Excessive or unnecessary use of modularization units CPU intensive program functions Inefficient or redundant database access

Three phases of the ABAP runtime analysis. 1. Setting limits for the data that is measured 2. Measuring the data 3. Analyzing the data.

Runtime Analysis
SAP Menu Test Runtime analysis

Initial Screen

Tips and Tricks

Measurement restrictions
Transaction Program Function

Current Session

Parallel Session

Performance data evaluation

Standard Groups Tables Classes Instances Methods Events

List Viewer

Dep. On aggregation

Hit Lists

ABC analysis

Call hierarchy

Statistics

ABAP Dictionary
Tables

ABAP Editor

Runtime Analysis
Initial Screen

Runtime Analysis
Variant: Statements Filter

Limit the trace to specified type of program statements.

Runtime Analysis
Variant: Duration and Type

Max File size default is 2meg


Aggregation: Full one trace record for each program part or instruction. By Call one trace record for every calling position None one trace record for each call. LARGE FILE!

Runtime Analysis
Measurement Overview Abap interpreter Database System Statements

Green bar indicates less that 50% of the total runtime. Database bar will be red when more than 25% runtime.

Runtime Analysis
Database Table Hit List shows table names number of
accesses , table type and buffering mode sorted by access time.

Runtime Analysis
Group Hit List
Individual call instructions grouped by categories. Indicates the gross runtime and the number of times executed.

Runtime Analysis
Internal Table Hit List
List of all internal table accesses. Shows the number of accesses, the gross and net time required and the total memory consumed.

Runtime Analysis
Call Hierarchy
Shows the chronological sequence of analyzed objects, the gross and net time taken at each call level.

Runtime Analysis -Statistics

Runtime Analysis
Statistics
Program Load Size Global data def. Program name Memory occupied by the program when loaded (in bytes) Memory occupied by the global data of the program when loaded (in bytes)

Defined methods
Called methods Defined forms Called forms Called F. modules RFC call.

Number of methods defined in the specified program


Number of methods called from the specified program Number of form routines defined in the specified program Number of form routines called in the specified program

Defined F modules Number of function modules defined within a function group


Number of function modules called from a module pool Number of Remote Function Calls

Summary
Always perform static source evaluation Do not leave a trace running for an extended period of time, consume system resources You must be logged in to the same appserver as the process you are tracing. Powerful set of analysis tools With power and the freedom to use them comes responsibility

Questions?

Вам также может понравиться