SlideShare a Scribd company logo
COBOL Performance Tuning Paper -
lessons learned
Speaker: Tom Ross
IBM
March 2
Session Number 8833
2
Agenda
• Performance of COBOL compilers - myths and realities
• Performance improvements over the years
• Highlights of updates to Performance Tuning Paper
• Coding tips
3
Myths and Realities
• Performance of COBOL compilers - myths and realities
• IBM marketing materials imply performance improvements
• Improved generated code is available in PL/I and C/C++
• Wishful thinking adds to the misconception
• IBM COBOL compilers are extremely efficient!
• Dev process includes regular performance scrutiny
• COBOL does run faster on newer processors
4
? Compilers exploit new hardware instructions introduced by System z (z9? z10?)
? Code generated by the compilers is highly tuned for System z
? Boost in performance of applications running on System z
z/OS XL C/C++
? standards compliant C/C++ compilers to support porting code
? METAL C compiler option to support low-level programming
Enterprise COBOL for z/OS
? support for modernization of applications (XML support and
Java support)
? integration with middleware such as CICS, DB2, and IMS
Enterprise PL/I for z/OS
? facilitates repurposing of existing business processes into new
business models
? Integration with IBM middleware (CICS, DB2, and IMS)
? 135 new / changed Instructions (z196)
IBM Compilers exploit System z for Maximum Performance
5
Myths/facts about z196 and COBOL
• The 135 new and changed instructions were added or
changed for many reasons, not just for performance
• Examples:
• Cryptographic facility instructions
• BFP and DFP floating point instructions
• The z196 processor processes all instructions faster than
the z10 does, even old COBOL!
• IBM COBOL development is working on a new compiler
design to make it easier to exploit new hardware
instructions as they are introduced
6
Summary of new z196 instructions
• The IBM zEnterprise 196 provides a broad range of new facilities to
improve performance and function:
• High-word facility (30 instructions)
• Interlocked-access facility (12 instructions)
• Load/store-on-condition facility (6 instructions)
• Distinct-operands facility (22 instructions)
• Population-count facility (1 instruction)
• Enhanced-floating-point facility (25 new, 30 changed instructions)
• MSA-X4 facility (4 new, 3 changed instructions, new functions)
• Etc.
• Potential for:
• Significant performance improvement
• Enhanced capabilities
• Simpler code
Index
7
Performance improvements over the
years for COBOL compilers
• VS COBOL II
• Many performance improvements over 6 releases result in
very fast code produced by IBM COBOL compilers
• COBOL V2R2
• Significant performance improvement in processing binary
data with the TRUNC(BIN) compiler option
• COBOL V4R1
• Performance of COBOL application programs has been
enhanced by exploitation of new z/Architecture® instructions.
The performance of COBOL Unicode support (USAGE
NATIONAL data) has been significantly improved.
8
Performance tuning paper updated
• As the result of a SHARE requirement, we were able to
apply resources to getting the COBOL Performance
Tuning Paper updated for COBOL V4R2
• The last time it was updated was for COBOL V3R1, 2001
• Online at:
http://www-01.ibm.com/software/awdtools/cobol/zos/library/
• New info since V3R1 version:
• BLOCK0, XMLPARSE, INTERRUPT
• Updated section
• CICS communication
9
Performance tuning paper updated
• BLOCK0 compiler option
• New V4R2 option to change default behavior for QSAM
output files
• For 40 years, no BLOCK CONTAINS clause meant:
• BLOCK CONTAINS 1 RECORD
• The slowest possible!
• Counterpoint: the file is always current
• BLOCK0 changes the compiler default for QSAM files from
unblocked to blocked (as if BLOCK CONTAINS 0 were
specified) and thus gain the benefit of system-determined
blocking for output files.
10
Performance tuning paper updated
• Specifying BLOCK0 activates an implicit BLOCK
CONTAINS 0 clause for each file in the program that
meets the following three criteria:
• The FILE-CONTROL paragraph either specifies
ORGANIZATION SEQUENTIAL or omits the
ORGANIZATION clause.
• The FD entry does not specify RECORDING MODE U.
• The FD entry does not specify a BLOCK CONTAINS clause.
11
Performance tuning paper updated
• BLOCK 0 compiler option…results?
• Performance considerations using BLOCK0 on a program
with a file that meets the criteria:
• One program using BLOCK0 was 88% faster than using
NOBLOCK0 and used 98% fewer EXCPs.
12
Performance tuning paper updated
• XMLPARSE compiler option
• There are 3 parsers in COBOL today
• COBOL V3 parser, available in V4 as XMLPARSE(COMPAT)
• Selected by compiler option
• XMLSS non-validating parser (COBOL V4R1)
• Selected by compiler option
• XMLSS validating parser (COBOL V4R2)
• Selected by compiler option + VALIDATING WITH clause
• Do not change to XMLSS from V3 (COMPAT) parser unless
you need the extra functionality!
• Customer feedback and testing show it is a lot slower
13
Performance tuning paper updated
• XMLPARSE compiler option…Results?
• Performance considerations for XML PARSE example:
• Five programs using XML PARSE were from 20% to 108%
slower when using XMLPARSE(XMLSS) compared to using
XMLPARSE(COMPAT).
14
Performance tuning paper updated
• INTERRUPT run-time option
• The 3R1 version of performance tuning paper did not
cover this option
• The INTERRUPT option causes attention interrupts to be
recognized by Language Environment. When you cause
an interrupt, Language Environment can give control to
your application or to Debug Tool.
• Performance considerations using INTERRUPT:
• On the average, INTERRUPT(ON) was 1% slower than
INTERRUPT(OFF), with a range of equivalent to 18% slower
15
Performance tuning paper updated
• SIMVRD run-time option…removed support!
• The SIMVRD option specifies whether COBOL programs
use a VSAM KSDS to simulate variable-length relative
organization data set. This support is only available with VS
COBOL II through Enterprise COBOL Version 3 programs.
Starting with Enterprise COBOL Version 4 programs, this
support is no longer available.
• Performance considerations using SIMVRD:
• One VSAM test case compiled with Enterprise COBOL 3.4
was 5% slower when using SIMVRD compared to
NOSIMVRD.
• Those concerned with performance will not miss SIMVRD!
16
Performance tuning paper updated
• Program communication under CICS
• Choices: static CALL, dynamic CALL or EXEC CICS LINK
• In many cases EXEC CICS LINK can be replaced with
COBOL dynamic CALL (similar separate load module
characteristic)
• DYNAM compiler option is not allowed for programs with
EXEC CICS statements in CICS, so you must use CALL
identifier to do dynamic CALL in these cases
• In some cases dynamic CALL cannot replace CICS LINK:
• Cross systems EXEC CICS LINK
• If subprograms ABEND or STOP RUN, they will stop the
caller unless EXEC CICS LINK is used
17
Performance tuning paper updated
• Program communication under CICS
• Performance considerations using CICS (measuring call
overhead only):
• One test case was 446% slower using EXEC CICS LINK
compared to using COBOL dynamic CALL with
CBLPSHPOP(ON)
• The same test case was 7817% slower using EXEC CICS
LINK compared to using COBOL dynamic CALL with
CBLPSHPOP(OFF)
• The same test case was 1350% slower using COBOL
dynamic CALL with CBLPSHPOP(ON) compared to using
COBOL dynamic CALL with CBLPSHPOP(OFF)
18
Performance tuning paper updated
• To show the magnitude of the difference in CPU times
between the above methods, here are the CPU times that
were obtained from running each of these tests on our
system and may not be representative of the results on
your system.
0.006COBOL dynamic CALL
CBLPSHPOP(OFF)
0.087COBOL dynamic CALL
CBLPSHPOP(ON)
0.475EXEC CICS LINK
CPU Time (seconds)'call' type
19
Performance tuning paper updated
• COBOL normally either ignores decimal overflow
conditions or handles them by checking the condition code
after the decimal instruction. ILC triggers switch to a
language-neutral or ILC program mask
• This ILC program mask enables decimal overflow
• (COBOL-only program mask ignores overflow)
• COBOL code also tests condition after decimal instructions
• Overflows cause program calls to condition handling
• Overflows can be very common in COBOL
• Result: COBOL math can get bogged down
20
Performance tuning paper updated
• Performance considerations for a mixed COBOL with C or
PL/I application with COBOL using PACKED-DECIMAL
data types in 100,000 arithmetic statements that cause a
decimal overflow condition (100,000 overflows):
• Without C or PL/I: .040 seconds of CPU time
• With C or PL/I: 1.636 seconds of CPU time
21
Performance tuning paper updated
• XML GENERATE and XML PARSE result in bringing a C
signature into your module - ILC!
• Solutions?
• If XML processing is a special case, move XML processing
into a dynamically called subroutine
• Process XML in separate processes if possible
22
Performance tuning paper updated
• SEARCH - binary versus serial
• We got the question: Is there a point (a small enough
number of items searched) where a serial search is faster
than a binary SEARCH?
• Answer: it depends on your data!
• Performance considerations for search example:
• Using a binary search (SEARCH ALL) to search a 100-
element table was 15% faster than using a sequential search
(SEARCH)
• Using a binary search (SEARCH ALL) to search a 1000-
element table was 500% faster than using a sequential
search (SEARCH)
23
Performance tuning paper updated
• UPPER and LOWER case conversion
• When converting data to upper or lower case, it is
generally more efficient to use INSPECT CONVERTING
than the intrinsic functions FUNCTION UPPER-CASE or
FUNCTION LOWER-CASE.
• Performance considerations for character conversions:
• One test case that does 1,000 uppercase conversions was
35% faster when using INSPECT CONVERTING compared
to using FUNCTION UPPER-CASE or FUNCTION LOWER-
CASE
• For this same test case, these intrinsic functions used 70%
more storage than INSPECT CONVERTING
24
Performance tuning paper updated
• Initializing Data
• The INITIALIZE statement sets selected categories of data
fields to predetermined values.
• However, it is inefficient to initialize an entire group unless
you really need all the items in the group to be initialized to
different value.
• If you have a group that contains OCCURS data items and
you want to set all items in the group to the same
character (for example, space or x'00'), it is generally more
efficient to use a MOVE statement instead of the
INITIALIZE statement.
25
Performance tuning paper updated
• Initializing Data
• Performance considerations for INITIALIZE on a program
that has 5 OCCURS clauses in the group:
• When each OCCURS clause in the group contained 100
elements, a MOVE to the group was 8% faster than an
INITIALIZE of the group.
• When each OCCURS clause in the group contained 1000
elements, a MOVE to the group was 23% faster than an
INITIALIZE of the group.
26
Coding tips from customer situations
• Avoid INITIALIZE unless the functionality is really needed
• Much faster to MOVE SPACES or x'00' to the group
• If individual fields need to be set to spaces or different types
of zero (external decimal, packed-decimal, numeric-edited)
then by all means use INITIALIZE
• Rule: Don't use INITIALIZE just because it is there!
27
Coding tips from customer situations
• One customer got recommendation from consultant to
code in Java instead of COBOL
• Customer would have preferred to code in COBOL
• He complained of continued issues with slow performance
and missing Service Level Agreements(SLAs) due to poor
Java performance
28
Coding tips from customer situations
• One customer found that COBOL performance was better
than PL/I and wanted to start using only COBOL for new
applications (they are 50/50 COBOL and PL/I)
• The customer wanted to have replacements for commonly
used PL/I functions:
• VERIFY
• TRIM
• INDEX
• When they tried to code these in COBOL they found they
were too slow
• They asked me to try to do better…
29
Coding tips from customer situations
* VERIFY PL/I function written in COBOL: slow
MOVE '02.04.2010' TO TEXT1
MOVE TEXT1 TO TEXT2
INSPECT TEXT2 REPLACING ALL '.' BY '0'
IF TEXT2 IS NOT NUMERIC
MOVE 'NOT DATE' TO TEXT1
END-IF
30
Coding tips from customer situations
* VERIFY PL/I function written in COBOL: 40% faster
SPECIAL-NAMES.
CLASS VDATE IS '0' thru '9' '.'.
. . .
MOVE '02.04.2010' TO TEXT1
IF TEXT1 IS Not VDATE Then
MOVE 'NOT DATE' TO TEXT1
END-IF
31
Coding tips from customer situations
* TRIM PL/I function written in COBOL: slow
MOVE ' This is string 1 ' TO TEXT1
COMPUTE POS1 POS2 = 0
INSPECT TEXT1
TALLYING POS1
FOR LEADING SPACES
INSPECT FUNCTION REVERSE(TEXT1)
TALLYING POS2
FOR LEADING SPACES
MOVE TEXT1(POS1:LENGTH OF TEXT1 - POS2 - POS1)
TO TEXT2
32
Coding tips from customer situations
* TRIM PL/I function written in COBOL: 31% faster
MOVE ' This is string 1 ' TO TEXT1
PERFORM VARYING POS1 FROM 1 BY 1
UNTIL TEXT1(POS1:1) NOT = SPACE
END-PERFORM
PERFORM VARYING POS2 FROM LENGTH OF TEXT1
BY -1 UNTIL TEXT1(POS2:1) NOT = SPACE
END-PERFORM
COMPUTE LEN = POS2 - POS1 + 1
MOVE TEXT1(POS1 : LEN) TO TEXT2 (1 : LEN)
33
Coding tips from customer situations
* INDEX PL/I function written in COBOL: slow
MOVE 'TestString1 TestString2' TO BUFFER
COMPUTE POS = 0
INSPECT BUFFER
TALLYING POS
FOR CHARACTERS
BEFORE INITIAL 'TestString2'
34
Coding tips from customer situations
* INDEX PL/I function written in COBOL: 83% faster
MOVE 'TestString1 TestString2' TO BUFFER
PERFORM VARYING POS FROM 1 BY 1
UNTIL BUFFER(POS:11) = 'TestString2'
END-PERFORM
35
Questions about formatted dumps
• One program with a large data division (about 1 million
items) using TEST(NOHOOK) took 330 times more CPU
time to produce a CEEDUMP with COBOL's formatted
variables compared to using NOTEST to produce a
CEEDUMP without COBOL's formatted variables.
• Do you use formatted dumps?
• IE: Compile with TEST(NOHOOK) or TEST(NONE) for
production programs
• Do you care about DUMP performance?
• Usually not done in online environments

More Related Content

Viewers also liked

1004 z2 env_positioned
1004 z2 env_positioned1004 z2 env_positioned
1004 z2 env_positioned
Henning Blohm
 
Automatic Performance Improvement for Legacy COBOL
Automatic Performance Improvement for Legacy COBOLAutomatic Performance Improvement for Legacy COBOL
Automatic Performance Improvement for Legacy COBOL
DevOps for Enterprise Systems
 
Problem Determination Tools
Problem Determination ToolsProblem Determination Tools
Problem Determination Tools
CICS ROADSHOW
 
myslide1
myslide1myslide1
myslide1
Sandeep Putrevu
 
IBM Cobol Programming
IBM Cobol ProgrammingIBM Cobol Programming
IBM Cobol ProgrammingRui Andrade
 
O novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABO
O novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABOO novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABO
O novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABO
Paulo Batuta
 
Cobol training class-1
Cobol training class-1Cobol training class-1
Cobol training class-1
Anil Polsani
 
Licenze... cpoyright, copyleft e pubblico dominio
Licenze... cpoyright, copyleft e pubblico dominioLicenze... cpoyright, copyleft e pubblico dominio
Licenze... cpoyright, copyleft e pubblico dominio
Anna Mancuso
 
Converting to the latest COBOL Compiler made simple with the right tools
Converting to the latest COBOL Compiler made simple with the right toolsConverting to the latest COBOL Compiler made simple with the right tools
Converting to the latest COBOL Compiler made simple with the right tools
DevOps for Enterprise Systems
 
Elevating Application Performance with the latest IBM COBOL offerings
Elevating Application Performance with the latest IBM COBOL offeringsElevating Application Performance with the latest IBM COBOL offerings
Elevating Application Performance with the latest IBM COBOL offerings
DevOps for Enterprise Systems
 
1006 Z2 Intro Complete
1006 Z2 Intro Complete1006 Z2 Intro Complete
1006 Z2 Intro Complete
Henning Blohm
 
Cobol basics 19-6-2010
Cobol basics 19-6-2010Cobol basics 19-6-2010
Cobol basics 19-6-2010
SivaprasanthRentala1975
 

Viewers also liked (12)

1004 z2 env_positioned
1004 z2 env_positioned1004 z2 env_positioned
1004 z2 env_positioned
 
Automatic Performance Improvement for Legacy COBOL
Automatic Performance Improvement for Legacy COBOLAutomatic Performance Improvement for Legacy COBOL
Automatic Performance Improvement for Legacy COBOL
 
Problem Determination Tools
Problem Determination ToolsProblem Determination Tools
Problem Determination Tools
 
myslide1
myslide1myslide1
myslide1
 
IBM Cobol Programming
IBM Cobol ProgrammingIBM Cobol Programming
IBM Cobol Programming
 
O novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABO
O novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABOO novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABO
O novo IBM COBOL ENTERPRISE V5/V6 para zOS e o IBM ABO
 
Cobol training class-1
Cobol training class-1Cobol training class-1
Cobol training class-1
 
Licenze... cpoyright, copyleft e pubblico dominio
Licenze... cpoyright, copyleft e pubblico dominioLicenze... cpoyright, copyleft e pubblico dominio
Licenze... cpoyright, copyleft e pubblico dominio
 
Converting to the latest COBOL Compiler made simple with the right tools
Converting to the latest COBOL Compiler made simple with the right toolsConverting to the latest COBOL Compiler made simple with the right tools
Converting to the latest COBOL Compiler made simple with the right tools
 
Elevating Application Performance with the latest IBM COBOL offerings
Elevating Application Performance with the latest IBM COBOL offeringsElevating Application Performance with the latest IBM COBOL offerings
Elevating Application Performance with the latest IBM COBOL offerings
 
1006 Z2 Intro Complete
1006 Z2 Intro Complete1006 Z2 Intro Complete
1006 Z2 Intro Complete
 
Cobol basics 19-6-2010
Cobol basics 19-6-2010Cobol basics 19-6-2010
Cobol basics 19-6-2010
 

Similar to Cobol performance tuning paper lessons learned - s8833 tr

Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
Koan-Sin Tan
 
Continued Innovation in IBM z/System Sort Optimization with Syncsort MFX
Continued Innovation in IBM z/System Sort Optimization with Syncsort MFXContinued Innovation in IBM z/System Sort Optimization with Syncsort MFX
Continued Innovation in IBM z/System Sort Optimization with Syncsort MFX
Precisely
 
OPNFV and OCP: Perfect Together
OPNFV and OCP: Perfect TogetherOPNFV and OCP: Perfect Together
OPNFV and OCP: Perfect Together
OPNFV
 
Callgraph analysis
Callgraph analysisCallgraph analysis
Callgraph analysis
Roberto Agostino Vitillo
 
IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...
IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...
IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...
DevOps for Enterprise Systems
 
Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016
LibreCon
 
Cobol簡介
Cobol簡介Cobol簡介
Cobol簡介
PromaxJacky
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & Tricks
Senturus
 
Sparc t4 systems customer presentation
Sparc t4 systems customer presentationSparc t4 systems customer presentation
Sparc t4 systems customer presentation
solarisyougood
 
Webinar: High Performance MongoDB Applications with IBM POWER8
Webinar: High Performance MongoDB Applications with IBM POWER8Webinar: High Performance MongoDB Applications with IBM POWER8
Webinar: High Performance MongoDB Applications with IBM POWER8
MongoDB
 
The state of Hive and Spark in the Cloud (July 2017)
The state of Hive and Spark in the Cloud (July 2017)The state of Hive and Spark in the Cloud (July 2017)
The state of Hive and Spark in the Cloud (July 2017)
Nicolas Poggi
 
Advantages of migrating to db2 v11.1
Advantages of migrating to db2 v11.1Advantages of migrating to db2 v11.1
Advantages of migrating to db2 v11.1
Rajesh Pandhare
 
Service-Level Objective for Serverless Applications
Service-Level Objective for Serverless ApplicationsService-Level Objective for Serverless Applications
Service-Level Objective for Serverless Applications
alekn
 
OpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC SystemsOpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC Systems
HPCC Systems
 
IBM Impact session CICS V52 overview
IBM Impact session CICS V52 overview IBM Impact session CICS V52 overview
IBM Impact session CICS V52 overview
nick_garrod
 
IBM POWER8 as an HPC platform
IBM POWER8 as an HPC platformIBM POWER8 as an HPC platform
IBM POWER8 as an HPC platform
Alexander Pozdneev
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
Akhil Kaushik
 
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
Cheer Chain Enterprise Co., Ltd.
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
John Campbell
 
CICS TS 5.1 Loader Domain enhancements
CICS TS 5.1 Loader Domain enhancementsCICS TS 5.1 Loader Domain enhancements
CICS TS 5.1 Loader Domain enhancements
Larry Lawler
 

Similar to Cobol performance tuning paper lessons learned - s8833 tr (20)

Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
 
Continued Innovation in IBM z/System Sort Optimization with Syncsort MFX
Continued Innovation in IBM z/System Sort Optimization with Syncsort MFXContinued Innovation in IBM z/System Sort Optimization with Syncsort MFX
Continued Innovation in IBM z/System Sort Optimization with Syncsort MFX
 
OPNFV and OCP: Perfect Together
OPNFV and OCP: Perfect TogetherOPNFV and OCP: Perfect Together
OPNFV and OCP: Perfect Together
 
Callgraph analysis
Callgraph analysisCallgraph analysis
Callgraph analysis
 
IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...
IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...
IBM Z for the Digital Enterprise 2018 - Leverage best language for Transforma...
 
Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016
 
Cobol簡介
Cobol簡介Cobol簡介
Cobol簡介
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & Tricks
 
Sparc t4 systems customer presentation
Sparc t4 systems customer presentationSparc t4 systems customer presentation
Sparc t4 systems customer presentation
 
Webinar: High Performance MongoDB Applications with IBM POWER8
Webinar: High Performance MongoDB Applications with IBM POWER8Webinar: High Performance MongoDB Applications with IBM POWER8
Webinar: High Performance MongoDB Applications with IBM POWER8
 
The state of Hive and Spark in the Cloud (July 2017)
The state of Hive and Spark in the Cloud (July 2017)The state of Hive and Spark in the Cloud (July 2017)
The state of Hive and Spark in the Cloud (July 2017)
 
Advantages of migrating to db2 v11.1
Advantages of migrating to db2 v11.1Advantages of migrating to db2 v11.1
Advantages of migrating to db2 v11.1
 
Service-Level Objective for Serverless Applications
Service-Level Objective for Serverless ApplicationsService-Level Objective for Serverless Applications
Service-Level Objective for Serverless Applications
 
OpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC SystemsOpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC Systems
 
IBM Impact session CICS V52 overview
IBM Impact session CICS V52 overview IBM Impact session CICS V52 overview
IBM Impact session CICS V52 overview
 
IBM POWER8 as an HPC platform
IBM POWER8 as an HPC platformIBM POWER8 as an HPC platform
IBM POWER8 as an HPC platform
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
 
CICS TS 5.1 Loader Domain enhancements
CICS TS 5.1 Loader Domain enhancementsCICS TS 5.1 Loader Domain enhancements
CICS TS 5.1 Loader Domain enhancements
 

Recently uploaded

The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 

Recently uploaded (20)

The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 

Cobol performance tuning paper lessons learned - s8833 tr

  • 1. COBOL Performance Tuning Paper - lessons learned Speaker: Tom Ross IBM March 2 Session Number 8833
  • 2. 2 Agenda • Performance of COBOL compilers - myths and realities • Performance improvements over the years • Highlights of updates to Performance Tuning Paper • Coding tips
  • 3. 3 Myths and Realities • Performance of COBOL compilers - myths and realities • IBM marketing materials imply performance improvements • Improved generated code is available in PL/I and C/C++ • Wishful thinking adds to the misconception • IBM COBOL compilers are extremely efficient! • Dev process includes regular performance scrutiny • COBOL does run faster on newer processors
  • 4. 4 ? Compilers exploit new hardware instructions introduced by System z (z9? z10?) ? Code generated by the compilers is highly tuned for System z ? Boost in performance of applications running on System z z/OS XL C/C++ ? standards compliant C/C++ compilers to support porting code ? METAL C compiler option to support low-level programming Enterprise COBOL for z/OS ? support for modernization of applications (XML support and Java support) ? integration with middleware such as CICS, DB2, and IMS Enterprise PL/I for z/OS ? facilitates repurposing of existing business processes into new business models ? Integration with IBM middleware (CICS, DB2, and IMS) ? 135 new / changed Instructions (z196) IBM Compilers exploit System z for Maximum Performance
  • 5. 5 Myths/facts about z196 and COBOL • The 135 new and changed instructions were added or changed for many reasons, not just for performance • Examples: • Cryptographic facility instructions • BFP and DFP floating point instructions • The z196 processor processes all instructions faster than the z10 does, even old COBOL! • IBM COBOL development is working on a new compiler design to make it easier to exploit new hardware instructions as they are introduced
  • 6. 6 Summary of new z196 instructions • The IBM zEnterprise 196 provides a broad range of new facilities to improve performance and function: • High-word facility (30 instructions) • Interlocked-access facility (12 instructions) • Load/store-on-condition facility (6 instructions) • Distinct-operands facility (22 instructions) • Population-count facility (1 instruction) • Enhanced-floating-point facility (25 new, 30 changed instructions) • MSA-X4 facility (4 new, 3 changed instructions, new functions) • Etc. • Potential for: • Significant performance improvement • Enhanced capabilities • Simpler code Index
  • 7. 7 Performance improvements over the years for COBOL compilers • VS COBOL II • Many performance improvements over 6 releases result in very fast code produced by IBM COBOL compilers • COBOL V2R2 • Significant performance improvement in processing binary data with the TRUNC(BIN) compiler option • COBOL V4R1 • Performance of COBOL application programs has been enhanced by exploitation of new z/Architecture® instructions. The performance of COBOL Unicode support (USAGE NATIONAL data) has been significantly improved.
  • 8. 8 Performance tuning paper updated • As the result of a SHARE requirement, we were able to apply resources to getting the COBOL Performance Tuning Paper updated for COBOL V4R2 • The last time it was updated was for COBOL V3R1, 2001 • Online at: http://www-01.ibm.com/software/awdtools/cobol/zos/library/ • New info since V3R1 version: • BLOCK0, XMLPARSE, INTERRUPT • Updated section • CICS communication
  • 9. 9 Performance tuning paper updated • BLOCK0 compiler option • New V4R2 option to change default behavior for QSAM output files • For 40 years, no BLOCK CONTAINS clause meant: • BLOCK CONTAINS 1 RECORD • The slowest possible! • Counterpoint: the file is always current • BLOCK0 changes the compiler default for QSAM files from unblocked to blocked (as if BLOCK CONTAINS 0 were specified) and thus gain the benefit of system-determined blocking for output files.
  • 10. 10 Performance tuning paper updated • Specifying BLOCK0 activates an implicit BLOCK CONTAINS 0 clause for each file in the program that meets the following three criteria: • The FILE-CONTROL paragraph either specifies ORGANIZATION SEQUENTIAL or omits the ORGANIZATION clause. • The FD entry does not specify RECORDING MODE U. • The FD entry does not specify a BLOCK CONTAINS clause.
  • 11. 11 Performance tuning paper updated • BLOCK 0 compiler option…results? • Performance considerations using BLOCK0 on a program with a file that meets the criteria: • One program using BLOCK0 was 88% faster than using NOBLOCK0 and used 98% fewer EXCPs.
  • 12. 12 Performance tuning paper updated • XMLPARSE compiler option • There are 3 parsers in COBOL today • COBOL V3 parser, available in V4 as XMLPARSE(COMPAT) • Selected by compiler option • XMLSS non-validating parser (COBOL V4R1) • Selected by compiler option • XMLSS validating parser (COBOL V4R2) • Selected by compiler option + VALIDATING WITH clause • Do not change to XMLSS from V3 (COMPAT) parser unless you need the extra functionality! • Customer feedback and testing show it is a lot slower
  • 13. 13 Performance tuning paper updated • XMLPARSE compiler option…Results? • Performance considerations for XML PARSE example: • Five programs using XML PARSE were from 20% to 108% slower when using XMLPARSE(XMLSS) compared to using XMLPARSE(COMPAT).
  • 14. 14 Performance tuning paper updated • INTERRUPT run-time option • The 3R1 version of performance tuning paper did not cover this option • The INTERRUPT option causes attention interrupts to be recognized by Language Environment. When you cause an interrupt, Language Environment can give control to your application or to Debug Tool. • Performance considerations using INTERRUPT: • On the average, INTERRUPT(ON) was 1% slower than INTERRUPT(OFF), with a range of equivalent to 18% slower
  • 15. 15 Performance tuning paper updated • SIMVRD run-time option…removed support! • The SIMVRD option specifies whether COBOL programs use a VSAM KSDS to simulate variable-length relative organization data set. This support is only available with VS COBOL II through Enterprise COBOL Version 3 programs. Starting with Enterprise COBOL Version 4 programs, this support is no longer available. • Performance considerations using SIMVRD: • One VSAM test case compiled with Enterprise COBOL 3.4 was 5% slower when using SIMVRD compared to NOSIMVRD. • Those concerned with performance will not miss SIMVRD!
  • 16. 16 Performance tuning paper updated • Program communication under CICS • Choices: static CALL, dynamic CALL or EXEC CICS LINK • In many cases EXEC CICS LINK can be replaced with COBOL dynamic CALL (similar separate load module characteristic) • DYNAM compiler option is not allowed for programs with EXEC CICS statements in CICS, so you must use CALL identifier to do dynamic CALL in these cases • In some cases dynamic CALL cannot replace CICS LINK: • Cross systems EXEC CICS LINK • If subprograms ABEND or STOP RUN, they will stop the caller unless EXEC CICS LINK is used
  • 17. 17 Performance tuning paper updated • Program communication under CICS • Performance considerations using CICS (measuring call overhead only): • One test case was 446% slower using EXEC CICS LINK compared to using COBOL dynamic CALL with CBLPSHPOP(ON) • The same test case was 7817% slower using EXEC CICS LINK compared to using COBOL dynamic CALL with CBLPSHPOP(OFF) • The same test case was 1350% slower using COBOL dynamic CALL with CBLPSHPOP(ON) compared to using COBOL dynamic CALL with CBLPSHPOP(OFF)
  • 18. 18 Performance tuning paper updated • To show the magnitude of the difference in CPU times between the above methods, here are the CPU times that were obtained from running each of these tests on our system and may not be representative of the results on your system. 0.006COBOL dynamic CALL CBLPSHPOP(OFF) 0.087COBOL dynamic CALL CBLPSHPOP(ON) 0.475EXEC CICS LINK CPU Time (seconds)'call' type
  • 19. 19 Performance tuning paper updated • COBOL normally either ignores decimal overflow conditions or handles them by checking the condition code after the decimal instruction. ILC triggers switch to a language-neutral or ILC program mask • This ILC program mask enables decimal overflow • (COBOL-only program mask ignores overflow) • COBOL code also tests condition after decimal instructions • Overflows cause program calls to condition handling • Overflows can be very common in COBOL • Result: COBOL math can get bogged down
  • 20. 20 Performance tuning paper updated • Performance considerations for a mixed COBOL with C or PL/I application with COBOL using PACKED-DECIMAL data types in 100,000 arithmetic statements that cause a decimal overflow condition (100,000 overflows): • Without C or PL/I: .040 seconds of CPU time • With C or PL/I: 1.636 seconds of CPU time
  • 21. 21 Performance tuning paper updated • XML GENERATE and XML PARSE result in bringing a C signature into your module - ILC! • Solutions? • If XML processing is a special case, move XML processing into a dynamically called subroutine • Process XML in separate processes if possible
  • 22. 22 Performance tuning paper updated • SEARCH - binary versus serial • We got the question: Is there a point (a small enough number of items searched) where a serial search is faster than a binary SEARCH? • Answer: it depends on your data! • Performance considerations for search example: • Using a binary search (SEARCH ALL) to search a 100- element table was 15% faster than using a sequential search (SEARCH) • Using a binary search (SEARCH ALL) to search a 1000- element table was 500% faster than using a sequential search (SEARCH)
  • 23. 23 Performance tuning paper updated • UPPER and LOWER case conversion • When converting data to upper or lower case, it is generally more efficient to use INSPECT CONVERTING than the intrinsic functions FUNCTION UPPER-CASE or FUNCTION LOWER-CASE. • Performance considerations for character conversions: • One test case that does 1,000 uppercase conversions was 35% faster when using INSPECT CONVERTING compared to using FUNCTION UPPER-CASE or FUNCTION LOWER- CASE • For this same test case, these intrinsic functions used 70% more storage than INSPECT CONVERTING
  • 24. 24 Performance tuning paper updated • Initializing Data • The INITIALIZE statement sets selected categories of data fields to predetermined values. • However, it is inefficient to initialize an entire group unless you really need all the items in the group to be initialized to different value. • If you have a group that contains OCCURS data items and you want to set all items in the group to the same character (for example, space or x'00'), it is generally more efficient to use a MOVE statement instead of the INITIALIZE statement.
  • 25. 25 Performance tuning paper updated • Initializing Data • Performance considerations for INITIALIZE on a program that has 5 OCCURS clauses in the group: • When each OCCURS clause in the group contained 100 elements, a MOVE to the group was 8% faster than an INITIALIZE of the group. • When each OCCURS clause in the group contained 1000 elements, a MOVE to the group was 23% faster than an INITIALIZE of the group.
  • 26. 26 Coding tips from customer situations • Avoid INITIALIZE unless the functionality is really needed • Much faster to MOVE SPACES or x'00' to the group • If individual fields need to be set to spaces or different types of zero (external decimal, packed-decimal, numeric-edited) then by all means use INITIALIZE • Rule: Don't use INITIALIZE just because it is there!
  • 27. 27 Coding tips from customer situations • One customer got recommendation from consultant to code in Java instead of COBOL • Customer would have preferred to code in COBOL • He complained of continued issues with slow performance and missing Service Level Agreements(SLAs) due to poor Java performance
  • 28. 28 Coding tips from customer situations • One customer found that COBOL performance was better than PL/I and wanted to start using only COBOL for new applications (they are 50/50 COBOL and PL/I) • The customer wanted to have replacements for commonly used PL/I functions: • VERIFY • TRIM • INDEX • When they tried to code these in COBOL they found they were too slow • They asked me to try to do better…
  • 29. 29 Coding tips from customer situations * VERIFY PL/I function written in COBOL: slow MOVE '02.04.2010' TO TEXT1 MOVE TEXT1 TO TEXT2 INSPECT TEXT2 REPLACING ALL '.' BY '0' IF TEXT2 IS NOT NUMERIC MOVE 'NOT DATE' TO TEXT1 END-IF
  • 30. 30 Coding tips from customer situations * VERIFY PL/I function written in COBOL: 40% faster SPECIAL-NAMES. CLASS VDATE IS '0' thru '9' '.'. . . . MOVE '02.04.2010' TO TEXT1 IF TEXT1 IS Not VDATE Then MOVE 'NOT DATE' TO TEXT1 END-IF
  • 31. 31 Coding tips from customer situations * TRIM PL/I function written in COBOL: slow MOVE ' This is string 1 ' TO TEXT1 COMPUTE POS1 POS2 = 0 INSPECT TEXT1 TALLYING POS1 FOR LEADING SPACES INSPECT FUNCTION REVERSE(TEXT1) TALLYING POS2 FOR LEADING SPACES MOVE TEXT1(POS1:LENGTH OF TEXT1 - POS2 - POS1) TO TEXT2
  • 32. 32 Coding tips from customer situations * TRIM PL/I function written in COBOL: 31% faster MOVE ' This is string 1 ' TO TEXT1 PERFORM VARYING POS1 FROM 1 BY 1 UNTIL TEXT1(POS1:1) NOT = SPACE END-PERFORM PERFORM VARYING POS2 FROM LENGTH OF TEXT1 BY -1 UNTIL TEXT1(POS2:1) NOT = SPACE END-PERFORM COMPUTE LEN = POS2 - POS1 + 1 MOVE TEXT1(POS1 : LEN) TO TEXT2 (1 : LEN)
  • 33. 33 Coding tips from customer situations * INDEX PL/I function written in COBOL: slow MOVE 'TestString1 TestString2' TO BUFFER COMPUTE POS = 0 INSPECT BUFFER TALLYING POS FOR CHARACTERS BEFORE INITIAL 'TestString2'
  • 34. 34 Coding tips from customer situations * INDEX PL/I function written in COBOL: 83% faster MOVE 'TestString1 TestString2' TO BUFFER PERFORM VARYING POS FROM 1 BY 1 UNTIL BUFFER(POS:11) = 'TestString2' END-PERFORM
  • 35. 35 Questions about formatted dumps • One program with a large data division (about 1 million items) using TEST(NOHOOK) took 330 times more CPU time to produce a CEEDUMP with COBOL's formatted variables compared to using NOTEST to produce a CEEDUMP without COBOL's formatted variables. • Do you use formatted dumps? • IE: Compile with TEST(NOHOOK) or TEST(NONE) for production programs • Do you care about DUMP performance? • Usually not done in online environments