Automatic Performance Improvement for Legacy COBOL

21
Automatic Performance Improvement for Legacy COBOL Session 1810

Transcript of Automatic Performance Improvement for Legacy COBOL

Page 1: Automatic Performance Improvement for Legacy COBOL

Automatic Performance Improvement for Legacy COBOL Session 1810

Page 2: Automatic Performance Improvement for Legacy COBOL

Notices and Disclaimers

1

Copyright © 2016 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.

U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.

Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.

Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.

Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.

References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.

Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.

It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law

Page 3: Automatic Performance Improvement for Legacy COBOL

Notices and Disclaimers Con’t.

2

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.

IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®, FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®, StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.

Page 4: Automatic Performance Improvement for Legacy COBOL

Please Note:

3

• IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.

• Information regarding potential future products is intended to outline our general product direction and it should not be relied on in

making a purchasing decision. • The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any

material, code or functionality. Information about potential future products may not be incorporated into any contract. • The development, release, and timing of any future features or functionality described for our products remains at our sole discretion. • Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual

throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

Page 5: Automatic Performance Improvement for Legacy COBOL

IBM Automatic Binary Optimizer (ABO) for z/OS Overview: z/OS 2.2 Release Nov. 2015; z/OS 2.1: Feb. 19, 2016

• ABO improves performance of already compiled COBOL V3 & V4 programs • Optimize directly from the compiled program • No source level migration or recompilation or options tuning required • Leverage latest advanced COBOL optimization technology • Generate code to target latest z Systems (e.g. zEC12, zBC12, z13 & z13s) • Support in z/OS® 2.2 to automatically load optimized modules to target latest z

Systems

4

ABO Original Program Binaries

(Base ESA390) Optimized Program Binaries

(Latest z Systems)

Page 6: Automatic Performance Improvement for Legacy COBOL

ABO and COBOL Compiler: Complementary Tools

5

Use Case ABO COBOL Compiler

Significant Performance Improvement* *No Source, Migration or Options Tuning Required Interoperability/Legacy Compatibility: PDS supported, pre-Enterprise COBOL etc. Built in Support for Targeting Multiple Hardware Levels At Deployment No need to downgrade ARCH setting to match DR* machine Original compiled program always available for DR New COBOL development and new features Maintenance on existing COBOL programs Maximum Performance Improvement* *Source, Migration and Options Tuning Required

*DR Disaster Recovery Machine : Down level machine used for emergency situations. Usually 1 or 2 revisions old so puts limits on Compiler ARCH setting (and performance improvements possible) based on this older level

Page 7: Automatic Performance Improvement for Legacy COBOL

Compatibility and Testing

6

ABO consumes the original binary so the exact behavior

of the original program is known vs the documented

“correct” behavior when compiling from source

No compiler options (performance or otherwise)

are changing

The optimized program looks/behaves as the

original program from the outside (but faster!) so no interoperability concerns

with other programs Strong compatibility guarantee for the modules produced by ABO

Interoperability Unchanged Options

Binary As Input

If something goes wrong using the optimized module revert to using original program and call IBM

Failure Scenario

The recommended testing focus should be on performance and scalability (less on business logic) Testing

Page 8: Automatic Performance Improvement for Legacy COBOL

Tooling Support

• IBM Problem Determination Tools for z/OS support includes: – Fault Analyzer (FA) for z/OS – Debug Tool (DT) for z/OS – Application Performance Analyzer (APA) for

z/OS • Several 3rd party tooling vendors were

involved in our beta program this year – Please contact your tools vendor directly to

ask about support for ABO

7

APA FA

DT

Page 9: Automatic Performance Improvement for Legacy COBOL

ABO Supports Tooling Infrastructure

8

COBOL v4.2 compiler listing: 000027 COMPUTE 00042C F247 D110 8000 PACK 272(5,13),0(8,8) TS2=0 WS-VAR-1 000432 960F D114 OI 276(13),X'0F' TS2=4 000436 F247 D118 8008 PACK 280(5,13),8(8,8) TS2=8 WS-VAR-2 00043C 960F D11C OI 284(13),X'0F' TS2=12 000440 FA44 D110 D118 AP 272(5,13),280(5,13) TS2=0 TS2=8 000446 F374 8010 D110 UNPK 16(8,8),272(5,13) WS-VAR-3 TS2=0 00044C 96F0 8017 OI 23(8),X'F0' WS-VAR-3+7

Listing Transform: 00042C PACK 272(5,13),0(8,8) 000432 OI 276(13),15 0004C4 ED07 4000 00AA 00042C CDZT FP0,_WSA[0x12c] 0(8,R4),0x0 000436 PACK 280(5,13),8(8,8) 00043C OI 284(13),15 0004CA ED07 4008 10AA 000436 CDZT FP1,_WSA[0x12c] 8(8,R4),0x0 000440 AP 272(5,13),280(5,13) 0004D0 B3D2 1000 000440 ADTR FP0,FP0,FP1 000446 UNPK 16(8,8),272(5,13) 00044C OI 23(8),240 0004D4 ED07 4010 00A8 00044C CZDT FP0, 16(8,R4),0x0

COBOL Program: 000027 COMPUTE WS-VAR-3 = WS-VAR-1 + WS-VAR-2.

Input “source” instructions. Starts at column 1

Optimized Instructions. Starts at column 5

LEGEND: Source Line number in original program. CSECT offset of instruction generated by COBOL 4.2 Compiler CSECT offset of instructions generated by ABO

Each optimized instruction generated is also annotated with the “source” offset that it was generated for Allows tracking as instructions are re-ordered

Page 10: Automatic Performance Improvement for Legacy COBOL

Whole Program Optimization

9

• Unbind • Binary IR*

Internal Verification

• Optimize • Optimize • Optimize…

Internal Verification • IR Binary

• Rebind

Done

Optimized Executable

CSECT1 … CSECTN

Original Executable

CSECT1 … CSECTN

*IR - Intermediate Representation

Page 11: Automatic Performance Improvement for Legacy COBOL

User Scenarios

ABO

Optimization Configuration

z/OS

Page 12: Automatic Performance Improvement for Legacy COBOL

Example 1 : Binary Optimization Process Optimization, Test and Static Selection

z/OS 2.1/2.2

Selected Compiled Application Binaries

(e.g. Performance Sensitive)

1) Optimize and Test Application

ABO

2) Static Selection: Load + Run Application

JCL

Generates Testing*

Validates

Loads + Runs

Optimized Application Binaries (+debug metadata)

Optimized + Original Application

Binaries

*Testing focus on performance/scalability and less on business logic

Modified JCL Pointing To Optimized +

Original Application Binaries

Cha

nge

Man

agem

ent

Page 13: Automatic Performance Improvement for Legacy COBOL

Example 2: Binary Optimization Process Optimization, Test and Dynamic Selection

Selected Compiled Application Binaries

(e.g. Performance Sensitive)

1) Optimize and Test Application

ABO

2) Load + Run Application

JCL

Generates

Validates

Cha

nge

Man

agem

ent

Loads + Runs

Optimized + Original Application

Binaries

Original JCL Pointing Only to Original

Application Binaries

z/OS 2.2 Optimization

Product Infrastructure

Optimization Configuration

*Testing focus on performance/scalability and less on business logic

Optimized Application Binaries (+debug metadata)

Testing*

* SMF for tracking changes in Optimization configuration

SMF*

Page 14: Automatic Performance Improvement for Legacy COBOL

Performance: Internal Benchmark Suite And Early Customer Results

• Early customer results show performance gains of 5% 21% for a mix of v3 and v4 compiled input programs

• On internal benchmarks: 34% improvement. • Performance gains will vary by application but expected to average 15%

13

*Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.

Page 15: Automatic Performance Improvement for Legacy COBOL

Performance Example: Numeric Edited MOVE 2.35x (57%) Faster

14

01 WS-VAR-1 PIC S9(9)V99 COMP-3. 01 WS-VAR-2 PIC ZZZ,ZZZ,ZZ9.99. MOVE WS-VAR-1 to WS-VAR-2

Automatic Binary Optimizer Decompose edit behavior to a longer but much faster sequence TP 0(6,R4) ... UNPK 340(11,R10),0(6,R4) IIHF R1,1075847200 OI 350(,R10),X'F0' IILF R1,1797267488 ... ICM R1,X'3',349(,R10) CDPT FP0,0(6,R4),0x8 STCM R1,X'7',284(,R5) ...

V4 OPT(FULL) Uses traditional ED (edit) instruction MVC 272(15,13),103(10) L 2,300(0,9 ED 272(15,13),0(2) MVC 8(14,2),273(13)

Page 16: Automatic Performance Improvement for Legacy COBOL

Performance Example: Decimal To Float MOVE 3.97x (75%) Faster

15

01 WS-VAR-1 PIC S9(7)V99. 01 WS-VAR-2 comp-2. MOVE WS-VAR-1 to WS-VAR-2

Automatic Binary Optimizer Decimal to float conversion is inlined using a more efficient algorithm CVB R0,340(,R10) LD FP8,256(,R7) CXFR FP0,R6 DXR FP4,FP8 ... AXR FP4,FP0 LDXR FP0,FP4

V4 OPT(FULL) Library Call for decimal to float conversion Runtime path length is > 100 instructions L 3,92(0,9) L 15,268(0,3) V(IGZCFPC ) LA 1,227(0,10) BASR 14,15 MVC 16(8,2),272(13)

Page 17: Automatic Performance Improvement for Legacy COBOL

Thank You Your Feedback is Important!

Access the InterConnect 2016 Conference Attendee Portal to complete your session surveys from your

smartphone, laptop or conference kiosk.

Page 18: Automatic Performance Improvement for Legacy COBOL

Example 1 In Depth: Binary Optimization Process Optimization, Test and Static Selection

Selected Compiled Application

Binaries

1) Optimize and Test Application

ABO Testing

Optimized Application

Binaries

Using ABO in the static selection case is a matter of selecting compiled programs to optimize by using straightforward new JCL

//OPTIMIZE JOB //OPT EXEC PGM=BOZOPT,REGION=0M //STEPLIB DD DSN=$HLQ.BOZ110.SBOZMOD1,DISP=SHR //SYSPRINT DD DSN=$HLQ.BOZOUT.LISTING,DISP=SHR //SYSIN DD * BOPT IN=$HLQ.IN.LOAD(M*) OUT=$HLQ.OUT.LOAD.ZEC12 ARCH=10 BOPT IN=$HLQ.IN.LOAD(M*) OUT=$HLQ.OUT.LOAD.Z13 ARCH=11

JCL to compile all M* members from IN.LOAD to an OUT.LOAD for zEC12 and one for z13

Page 19: Automatic Performance Improvement for Legacy COBOL

Example 1 In Depth: Binary Optimization Process Optimization, Test and Static Selection (targeting multiple hardware levels)

z/OS 2.2/2.1

2) Static Selection

JCL Loads + Runs

Optimized + Original Application Binaries

Modified JCL Pointing To Optimized + Original

Application Binaries

Static selection requires modifications to all JCL that contained the original modules(s) to be updated to point to new modules(s) for each architecture being targeted

... //STEPLIB DD DSN=$HLQ.OUT.LOAD.ZEC12:$HLQ.IN.LOAD,DISP=SHR ...

... //STEPLIB DD DSN=$HLQ.OUT.LOAD.Z13:$HLQ.IN.LOAD,DISP=SHR ...

z13

zEC12

Page 20: Automatic Performance Improvement for Legacy COBOL

Example 2 In Depth: Binary Optimization Process Optimization, Test and Dynamic Selection

Selected Compiled Application

Binaries

1) Optimize and Test Application

ABO Testing

Optimized Application Binaries (+debug

metadata)

Using ABO in the dynamic selection case only requires ‘pointing’ to active configuration by specifying IEFOPZ in JCL

Optimization Configuration

OLDNEW ( OWNER(IBM) OLD( DSNAME (HLQ.IN.LOAD) ) NEW( DSNAME (HLQ.OUT.LOAD.ZEC12) ARCH(10) ) NEW( DSNAME (HLQ.OUT.LOAD.Z13) ARCH(11) ) INCLUDEMEMBERS(M*) INACTIVE )

//OPTIMIZE JOB //OPT EXEC PGM=BOZOPT,REGION=0M //STEPLIB DD DSN=$HLQ.BOZ110.SBOZMOD1,DISP=SHR //SYSPRINT DD DSN=$HLQ.BOZOUT.LISTING,DISP=SHR //SYSIN DD * IEFOPZ

Page 21: Automatic Performance Improvement for Legacy COBOL

Example 2 In Depth: Binary Optimization Process Optimization, Test and Dynamic Selection (targeting multiple hardware levels)

2) Load + Run Application

JCL

zEC12

Dynamic selection requires no modifications to JCL. The new z/OS infrastructure will select the highest ARCH ‘NEW’ dataset available for the current machine

Configurations trackable/auditable/viewable by SMF records and DISPLAY IEFOPZxx

z/OS 2.2

Optimization Product

Infrastructure Original JCL Pointing Only to Original Application

Binaries

Optimization Configuration

OLDNEW ( OWNER(IBM) OLD( DSNAME (HLQ.IN.LOAD) ) NEW( DSNAME (HLQ.OUT.LOAD.ZEC12) ARCH(10) ) NEW( DSNAME (HLQ.OUT.LOAD.Z13) ARCH(11) ) INCLUDEMEMBERS(M*) ACTIVE )

Unchanged JCL

SMF*

Optimized + Original Application Binaries

z13

... //STEPLIB DD DSN=$HLQ.IN.LOAD,DISP=SHR e.g. target z13 and zEC12 ...

* SMF for tracking changes in Optimization configuration