SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
Optimizing Your Visual COBOL
Applications
Darren Self & Chris Glazier
Micro Focus
2
Performance matters because…
• Locating Bottlenecks
• Tuning your Files and the
File Handler
• Configuring OpenESQL
Database Access
• Optimizing Your
Application
3
Agenda
Out of the Box Performance
Finely TunedBadly
The choice is yours…
• Visual COBOL Profiler
– Native code
– Report at COBOL
source level
• Visual Studio Profiler
– Managed code
– Report at method level
7
Locating the Bottlenecks
• Works with native code
• Compile with PROFILE directive
• Run application to generate .prf
• Run Profiler to create report
• What information does it provide?
– Gives the total execution time
– By section and paragraph
8
Visual COBOL Profiler
• Integrated with Visual Studio IDE
• Works with .NET managed code
• Allows comparison of profiling data
between different runs
• What information does it provide?
– Gives total execution time by module
– Shows hot code execution paths
9
Visual Studio Profiler
• Access Permissions
• File Definition - Keys
• Fine Tuning EXTFH.CFG
10
Tuning Your Files and the File Handler
Access Permissions
• Examine your data files on a per-file basis.
– How are they being used?
• When opening files:
– Don’t just use open I-O for everything
– Use exclusive access where possible
– Otherwise, allow only readers
– Only where absolutely necessary, give
all others complete access to the file
Access Permissions – Sharing Modes
• Can be specified in SELECT:
select test-file assign to “testfile.dat”
…
sharing with |all other|
|no other|.
or
lock mode is exclusive.
• Can be specified on OPEN:
open i-o sharing with |all other | test-file
|no other |
|read only|.
Access Permissions - READ
Reading 8,000,000 records from IDX Format 8 file
Sequentially
Time Taken to Read Records
Exclusive Access Allow Readers Allow All Others
2 mins 2 secs 4 mins 23 secs 8 mins 40 secs
File Definition - Keys
• If you don’t use it, then lose it! – each key needs
to be updated for each insert and delete.
• Shorter the key the better – fit more in a node
Time Taken to Create File
Number of Alternate Keys
2 Alternate
Keys
3 Alternate
Keys
4 Alternate
Keys
5 Alternate
Keys
5 mins 48 secs 6 mins 19 secs 6 mins 29 secs 30 mins 06 secs
File size
2 alternates = 4,908,620,800
3 alternates = 5,172,377,600
4 alternates = 5,500,134,400
5 alternates = 5,763,891,200
File Definition - Compression
• Data compression
– Minimal performance hit
• Index compression
– Always a performance hit, sometimes severe.
– File Handler must sequentially search entire
node when looking for a key
Compression
Compression Type
None Data Data + Keys
Sequential
WRITE
5 mins 35 secs 5 mins 45 secs 9 mins 50 secs
Random
READ
3 mins 34 secs 3 mins 46 secs 4 mins 56 secs
Sequential
READ
2 mins 04 secs 2 mins 46 secs 2 mins 50 secs
It doesn’t help…
Neither does this…
Fine Tuning the File Handler – EXTFH.CFG
• Options must be set in a configuration file
set EXTFH=c:extfh.cfg
Can be set in Visual Studio
app.config file
• Set on a per file basis
– INDEXCOUNT
– NODESIZE
– LOADONTOHEAP
INDEXCOUNT
• Specifies the number of index nodes to be cached for an
index file. - Default cache size used is now 32 nodes.
• Use when writing files where there are multiple keys
• Use when reading files randomly
• Reading files – sequentially may degrade performance
• Ideal INDEXCOUNT = (Max Tree Depth * No. keys) + No. keys
– Use rebuild /f - to find max tree depth
[XFH-DEFAULT]
[file1.dat]
INDEXCOUNT=42
INDEXCOUNT
8 million records, 5 alternate keys, resulting file 5GB
Time Taken to Create File
2 alt keys 3 alt keys 4 alt keys 5 alt keys
5 min 48 secs 6 min 19 secs 6 min 29 secs 7 mins 32 secs30 min 6 secs
NODESIZE
• The NODESIZE option specifies the size of the
index nodes to use for an indexed file when it is
created.
• NODESIZE={512|1024|4096|16384}
• Use when reading records sequentially
• Avoid using with INDEXCOUNT set high
[XFH-DEFAULT]
[file1.dat]
NODESIZE=4096
NODESIZE – Reading Records
NODESIZE Sequential Access Random Access
1024 3 mins 55 secs 3 mins 09 secs
4096 3 mins 03 secs 4 mins 01 secs
16384 1 mins 59 secs 4 mins 27 secs
LOADONTOHEAP
• Forces the File Handler to load an entire file
onto a memory heap
• All file operations execute in memory, only
writing back to disk when it is closed
• Use only in exclusive mode
• Use only on small files
• Use with caution- Speed vs Data Integrity!
[XFH-DEFAULT]
[file1.dat]
LOADONTOHEAP=ON
File Handling Summary
• Consider tuneables on a file-per-file basis
• Think about permissions.
Can you use exclusive access?
• Avoid key compression if possible.
• Random access – calculate the optimum
INDEXCOUNT figure with rebuild /f
• Sequential access – look at NODESIZE
• Small exclusive files – look at LOADONTOHEAP
• Database Drivers
• OpenESQL Behavior Directive
26
Configuring OpenESQL Database Access
• Drivers to use
– ODBC = Native Code
– ADO = Managed .NET
– JDBC = Managed JVM
• SQL Server - ODBC vs Native Client
– Do NOT use old SQL Server ODBC drivers
– Use SQL Server Native Client 10.0 or higher
• Oracle – ADO
– Use Oracle Data Provider ODP.NET
– Do not use Microsoft’s Oracle Client driver
27
Database Drivers
• SQL(BEHAVIOR=MAINFRAME) – Fastest
– data access for cursors is read only for all by default
– SQL Server uses firehose cursors, Oracle and DB2 use block fetches
• SQL(BEHAVIOR=ANSI) – Medium Fast
– data access for cursors is updateable for all by default
– SQL Server uses firehose cursors, Oracle and DB2 use block fetches
• SQL(BEHAVIOR=UNOPTIMIZED) – Slowest
– data access for cursors is updateable for all by default
– no block fetching done
– compatible with older MF products
• esqlconfigw utility - Set default BEHAVIOR directive for system
28
OpenESQL Behavior Directive
Optimization Demo
• Application Structure
• Program Structure
• Data
• Code
30
Optimizing Your Application
• It’s important!
• Execution formats
• Modularity
31
Application Structure
• INT code
– Slow, portable, dynamically loaded, not shared
• GNT code
– Fast, dynamically loaded, not shared
• Object code
– OS defined format, not directly executable
– Basis for native executable formats (exe, dll etc)
– More efficient than .gnt
• Managed code (IL, JVM)
– Third party managed environment
– Portable and interoperable on that framework
32
Execution Formats
• PERFORM - very fast
– Acts locally, potentially on all data
– Does not take parameters
• CALL - slower
– Called code is external
– Takes parameters
– Only those parameters are affected
33
Communicating
Demo - Execution Formats
• Compiled for JVM
– Uses JNI
– Notoriously slow
• Compiled for .NET
– Uses Platform Invoke
– Minimal overhead
36
Managed code boundary
• Independent procedures
• Logical separation of functionality
• Use sections/paragraphs consistently
37
Program Structure
• Do...
– Use SECTIONs
– PERFORM these sections
– Use GOBACK rather than EXIT PROGRAM
• Don’t...
– Use PERFORM THRU or PERFORM paragraphs
– Use inter-section GOTOs
– Use alter, segments, OSVS or RM PERFORM-STYLE
38
In Micro Focus, the guidelines are...
A Word on ‘In line Perform’s
• Excellent structured programming technique
• Keep the loop condition simple
– Remember it’s tested each iteration
• Avoid ‘goto’s out of the loop
– Code generator optimises well structured, single exit loops
– Easier to understand
– Avoid problems when moving to managed code
Data - Alignment
• Memory organised into 4 or 8 byte words
• Access across word boundaries is slow
– At least twice as slow
– Up to 50 times slower
• Access across word boundaries gives larger code
– Nine extra instructions for a 4 byte item
on Itanium machines
Data – Alignment Example
• This comp-5 item count-a is aligned
01 grp-item.
03 count-a pic x(4) comp-5.
03 ch pic x.
• This comp-5 item count-b is not aligned
01 grp2-item.
03 ch2 pic x.
03 count-b pic x(4) comp-5.
Data – Alignment Example in Tables
• The stride of a table should be a multiple of 4
– Pad the table to ensure this is true
• Misaligned table item
01 tbl1 occurs 200.
03 count-a pic x(4) comp-5.
03 ref-a pic x(2) comp-5.
03 loc-a pic x comp-5.
• Aligned table item
01 tbl2 occurs 200.
03 count-a pic x(4) comp-5.
03 ref-a pic x(2) comp-5.
03 loc-a pic x comp-5.
03 pic x.
Demo - Alignment Issues
Data Types - Numerics
• Optimal is 4 byte integer comp-5
– Signed or unsigned, but try not to mix in same statement
• 1, 2 or 8 byte OK if required
• Advantages
– Smaller faster code
– Required for some APIs
– Quicker to generate
Data Types – Managed
• Specify managed types whenever possible
– binary-long or float instead of COMP-3 or DISPLAY
– Use at 01 level
• no group items where possible
– Use types instead of COBOL PICs
• Managed code directives
– ILEXPONENTIATION”FLOAT” for exponentiation speed
Code - Arithmetic
• Use operands of same type
• Two operand style is always efficient
– add a to b
– divide c into d
• Compute statement without divide operations
– Split into separate COMPUTE and DIVIDE statements
• Avoid using the ON SIZE error
Demo – Arithmetic Issues
Your Mission...
• Identification
• Awareness
• Resolution
• Communication
– http://community.microfocus.com
Performance may feel like this...
When it should be like this...
Some Useful Checker Directives
Enforce use of scope delimiters
Catch subtle bugs early
noimplicitscope
Turn off run time checkingnocheck
Improves checker speed. Catches use of
identical, and confusing, paragraph names
noqualproc
Improves checker speed
noalter
noseg
Some useful NCG Directives
Specify aliasing of linkage itemslinkalias
Ensure calls are linked rather than
dynamically bound
litlink
Turn on global optimisations. Generates
faster code, but takes longer to generate
opt
Assert that linkage items aligned
Generates faster code
lnkalign
Turn off run time checking, including
subscript, linkage and divide-by-0 checks
nocheck
@microfocus or hashtag #devcon2013
Follow us on LinkedIn or join the group
Connect with your peers on the Community
2.4   Optimizing your Visual COBOL Applications

Contenu connexe

Similaire à 2.4 Optimizing your Visual COBOL Applications

Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programmingJuggernaut Liu
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inRahulBhole12
 
Optimizing thread performance for a genomics variant caller
Optimizing thread performance for a genomics variant callerOptimizing thread performance for a genomics variant caller
Optimizing thread performance for a genomics variant callerAllineaSoftware
 
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)Nexcess.net LLC
 
TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...
TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...
TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...TAUS - The Language Data Network
 
Reduced instruction set computers
Reduced instruction set computersReduced instruction set computers
Reduced instruction set computersSyed Zaid Irshad
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsAchievers Tech
 
MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...
MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...
MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...MongoDB
 
Presto: Fast SQL on Everything
Presto: Fast SQL on EverythingPresto: Fast SQL on Everything
Presto: Fast SQL on EverythingDavid Phillips
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化YUCHENG HU
 
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
 
Preparing Codes for Intel Knights Landing (KNL)
Preparing Codes for Intel Knights Landing (KNL)Preparing Codes for Intel Knights Landing (KNL)
Preparing Codes for Intel Knights Landing (KNL)AllineaSoftware
 
Software Engineering Advice from Google's Jeff Dean for Big, Distributed Systems
Software Engineering Advice from Google's Jeff Dean for Big, Distributed SystemsSoftware Engineering Advice from Google's Jeff Dean for Big, Distributed Systems
Software Engineering Advice from Google's Jeff Dean for Big, Distributed Systemsadrianionel
 
Top schools in gudgao
Top schools in gudgaoTop schools in gudgao
Top schools in gudgaoEdhole.com
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noidaEdhole.com
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblastpanagenda
 
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...EC-Council
 

Similaire à 2.4 Optimizing your Visual COBOL Applications (20)

Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programming
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation in
 
Breaking data
Breaking dataBreaking data
Breaking data
 
Optimizing thread performance for a genomics variant caller
Optimizing thread performance for a genomics variant callerOptimizing thread performance for a genomics variant caller
Optimizing thread performance for a genomics variant caller
 
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
 
TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...
TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...
TAUS Moses Industry Roundtable 2014, Changes in Moses, Hieu Hoang, University...
 
Reduced instruction set computers
Reduced instruction set computersReduced instruction set computers
Reduced instruction set computers
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...
MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...
MongoDB World 2019: Finding the Right MongoDB Atlas Cluster Size: Does This I...
 
Presto: Fast SQL on Everything
Presto: Fast SQL on EverythingPresto: Fast SQL on Everything
Presto: Fast SQL on Everything
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化
 
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
 
RISC.ppt
RISC.pptRISC.ppt
RISC.ppt
 
13 risc
13 risc13 risc
13 risc
 
Preparing Codes for Intel Knights Landing (KNL)
Preparing Codes for Intel Knights Landing (KNL)Preparing Codes for Intel Knights Landing (KNL)
Preparing Codes for Intel Knights Landing (KNL)
 
Software Engineering Advice from Google's Jeff Dean for Big, Distributed Systems
Software Engineering Advice from Google's Jeff Dean for Big, Distributed SystemsSoftware Engineering Advice from Google's Jeff Dean for Big, Distributed Systems
Software Engineering Advice from Google's Jeff Dean for Big, Distributed Systems
 
Top schools in gudgao
Top schools in gudgaoTop schools in gudgao
Top schools in gudgao
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noida
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
 
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
 

Plus de Micro Focus

North America Strategic Modernization Exec Forum
North America Strategic Modernization Exec Forum North America Strategic Modernization Exec Forum
North America Strategic Modernization Exec Forum Micro Focus
 
Tech Channel COBOL ebook
Tech Channel COBOL ebookTech Channel COBOL ebook
Tech Channel COBOL ebookMicro Focus
 
Unlocking COBOL Business Value
Unlocking COBOL Business ValueUnlocking COBOL Business Value
Unlocking COBOL Business ValueMicro Focus
 
Quietly confident, enduringly competent - COBOL.
Quietly confident, enduringly competent - COBOL. Quietly confident, enduringly competent - COBOL.
Quietly confident, enduringly competent - COBOL. Micro Focus
 
5 key capabilitie for a smart service desk solution infographic
5 key capabilitie for a smart service desk solution infographic5 key capabilitie for a smart service desk solution infographic
5 key capabilitie for a smart service desk solution infographicMicro Focus
 
SAP Fortify by Micro Focus.
SAP Fortify by Micro Focus. SAP Fortify by Micro Focus.
SAP Fortify by Micro Focus. Micro Focus
 
Digital Transformation pillars 2020
Digital Transformation pillars 2020Digital Transformation pillars 2020
Digital Transformation pillars 2020Micro Focus
 
Whats new in Enterprise 5.0 Product Suite
Whats new in Enterprise 5.0 Product SuiteWhats new in Enterprise 5.0 Product Suite
Whats new in Enterprise 5.0 Product SuiteMicro Focus
 
Micro Focus Corporate Overview
Micro Focus Corporate OverviewMicro Focus Corporate Overview
Micro Focus Corporate OverviewMicro Focus
 
Why attend the application modernization & connectivity track at Micro Focus ...
Why attend the application modernization & connectivity track at Micro Focus ...Why attend the application modernization & connectivity track at Micro Focus ...
Why attend the application modernization & connectivity track at Micro Focus ...Micro Focus
 
Micro Focus #DevDay50 - Atlanta
Micro Focus #DevDay50 - AtlantaMicro Focus #DevDay50 - Atlanta
Micro Focus #DevDay50 - AtlantaMicro Focus
 
Growth of Internet Data - 2017
Growth of Internet Data - 2017Growth of Internet Data - 2017
Growth of Internet Data - 2017Micro Focus
 
Easily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumEasily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumMicro Focus
 
The Journey to Mainframe DevOps
The Journey to Mainframe DevOpsThe Journey to Mainframe DevOps
The Journey to Mainframe DevOpsMicro Focus
 
Micro Focus extend 10 and 10.1 with AcuToWeb
Micro Focus extend 10 and 10.1 with AcuToWebMicro Focus extend 10 and 10.1 with AcuToWeb
Micro Focus extend 10 and 10.1 with AcuToWebMicro Focus
 
The COBOL Story by Wim Ebbinkhuijsen
The COBOL Story by Wim EbbinkhuijsenThe COBOL Story by Wim Ebbinkhuijsen
The COBOL Story by Wim EbbinkhuijsenMicro Focus
 
DevDay Copenhagen - Micro Focus overview and introduction
DevDay Copenhagen - Micro Focus overview and introductionDevDay Copenhagen - Micro Focus overview and introduction
DevDay Copenhagen - Micro Focus overview and introductionMicro Focus
 
The DevOps Journey
The DevOps JourneyThe DevOps Journey
The DevOps JourneyMicro Focus
 
ACUCOBOL - Product Strategy and Roadmap
ACUCOBOL - Product Strategy and RoadmapACUCOBOL - Product Strategy and Roadmap
ACUCOBOL - Product Strategy and RoadmapMicro Focus
 
#DevDay Copenhagen - Bluegarden Presentation
#DevDay Copenhagen - Bluegarden Presentation #DevDay Copenhagen - Bluegarden Presentation
#DevDay Copenhagen - Bluegarden Presentation Micro Focus
 

Plus de Micro Focus (20)

North America Strategic Modernization Exec Forum
North America Strategic Modernization Exec Forum North America Strategic Modernization Exec Forum
North America Strategic Modernization Exec Forum
 
Tech Channel COBOL ebook
Tech Channel COBOL ebookTech Channel COBOL ebook
Tech Channel COBOL ebook
 
Unlocking COBOL Business Value
Unlocking COBOL Business ValueUnlocking COBOL Business Value
Unlocking COBOL Business Value
 
Quietly confident, enduringly competent - COBOL.
Quietly confident, enduringly competent - COBOL. Quietly confident, enduringly competent - COBOL.
Quietly confident, enduringly competent - COBOL.
 
5 key capabilitie for a smart service desk solution infographic
5 key capabilitie for a smart service desk solution infographic5 key capabilitie for a smart service desk solution infographic
5 key capabilitie for a smart service desk solution infographic
 
SAP Fortify by Micro Focus.
SAP Fortify by Micro Focus. SAP Fortify by Micro Focus.
SAP Fortify by Micro Focus.
 
Digital Transformation pillars 2020
Digital Transformation pillars 2020Digital Transformation pillars 2020
Digital Transformation pillars 2020
 
Whats new in Enterprise 5.0 Product Suite
Whats new in Enterprise 5.0 Product SuiteWhats new in Enterprise 5.0 Product Suite
Whats new in Enterprise 5.0 Product Suite
 
Micro Focus Corporate Overview
Micro Focus Corporate OverviewMicro Focus Corporate Overview
Micro Focus Corporate Overview
 
Why attend the application modernization & connectivity track at Micro Focus ...
Why attend the application modernization & connectivity track at Micro Focus ...Why attend the application modernization & connectivity track at Micro Focus ...
Why attend the application modernization & connectivity track at Micro Focus ...
 
Micro Focus #DevDay50 - Atlanta
Micro Focus #DevDay50 - AtlantaMicro Focus #DevDay50 - Atlanta
Micro Focus #DevDay50 - Atlanta
 
Growth of Internet Data - 2017
Growth of Internet Data - 2017Growth of Internet Data - 2017
Growth of Internet Data - 2017
 
Easily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumEasily Create Scalable Automation using Selenium
Easily Create Scalable Automation using Selenium
 
The Journey to Mainframe DevOps
The Journey to Mainframe DevOpsThe Journey to Mainframe DevOps
The Journey to Mainframe DevOps
 
Micro Focus extend 10 and 10.1 with AcuToWeb
Micro Focus extend 10 and 10.1 with AcuToWebMicro Focus extend 10 and 10.1 with AcuToWeb
Micro Focus extend 10 and 10.1 with AcuToWeb
 
The COBOL Story by Wim Ebbinkhuijsen
The COBOL Story by Wim EbbinkhuijsenThe COBOL Story by Wim Ebbinkhuijsen
The COBOL Story by Wim Ebbinkhuijsen
 
DevDay Copenhagen - Micro Focus overview and introduction
DevDay Copenhagen - Micro Focus overview and introductionDevDay Copenhagen - Micro Focus overview and introduction
DevDay Copenhagen - Micro Focus overview and introduction
 
The DevOps Journey
The DevOps JourneyThe DevOps Journey
The DevOps Journey
 
ACUCOBOL - Product Strategy and Roadmap
ACUCOBOL - Product Strategy and RoadmapACUCOBOL - Product Strategy and Roadmap
ACUCOBOL - Product Strategy and Roadmap
 
#DevDay Copenhagen - Bluegarden Presentation
#DevDay Copenhagen - Bluegarden Presentation #DevDay Copenhagen - Bluegarden Presentation
#DevDay Copenhagen - Bluegarden Presentation
 

Dernier

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Dernier (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

2.4 Optimizing your Visual COBOL Applications

  • 1. Optimizing Your Visual COBOL Applications Darren Self & Chris Glazier Micro Focus
  • 3. • Locating Bottlenecks • Tuning your Files and the File Handler • Configuring OpenESQL Database Access • Optimizing Your Application 3 Agenda
  • 4. Out of the Box Performance
  • 6. The choice is yours…
  • 7. • Visual COBOL Profiler – Native code – Report at COBOL source level • Visual Studio Profiler – Managed code – Report at method level 7 Locating the Bottlenecks
  • 8. • Works with native code • Compile with PROFILE directive • Run application to generate .prf • Run Profiler to create report • What information does it provide? – Gives the total execution time – By section and paragraph 8 Visual COBOL Profiler
  • 9. • Integrated with Visual Studio IDE • Works with .NET managed code • Allows comparison of profiling data between different runs • What information does it provide? – Gives total execution time by module – Shows hot code execution paths 9 Visual Studio Profiler
  • 10. • Access Permissions • File Definition - Keys • Fine Tuning EXTFH.CFG 10 Tuning Your Files and the File Handler
  • 11. Access Permissions • Examine your data files on a per-file basis. – How are they being used? • When opening files: – Don’t just use open I-O for everything – Use exclusive access where possible – Otherwise, allow only readers – Only where absolutely necessary, give all others complete access to the file
  • 12. Access Permissions – Sharing Modes • Can be specified in SELECT: select test-file assign to “testfile.dat” … sharing with |all other| |no other|. or lock mode is exclusive. • Can be specified on OPEN: open i-o sharing with |all other | test-file |no other | |read only|.
  • 13. Access Permissions - READ Reading 8,000,000 records from IDX Format 8 file Sequentially Time Taken to Read Records Exclusive Access Allow Readers Allow All Others 2 mins 2 secs 4 mins 23 secs 8 mins 40 secs
  • 14. File Definition - Keys • If you don’t use it, then lose it! – each key needs to be updated for each insert and delete. • Shorter the key the better – fit more in a node Time Taken to Create File Number of Alternate Keys 2 Alternate Keys 3 Alternate Keys 4 Alternate Keys 5 Alternate Keys 5 mins 48 secs 6 mins 19 secs 6 mins 29 secs 30 mins 06 secs File size 2 alternates = 4,908,620,800 3 alternates = 5,172,377,600 4 alternates = 5,500,134,400 5 alternates = 5,763,891,200
  • 15. File Definition - Compression • Data compression – Minimal performance hit • Index compression – Always a performance hit, sometimes severe. – File Handler must sequentially search entire node when looking for a key
  • 16. Compression Compression Type None Data Data + Keys Sequential WRITE 5 mins 35 secs 5 mins 45 secs 9 mins 50 secs Random READ 3 mins 34 secs 3 mins 46 secs 4 mins 56 secs Sequential READ 2 mins 04 secs 2 mins 46 secs 2 mins 50 secs
  • 19. Fine Tuning the File Handler – EXTFH.CFG • Options must be set in a configuration file set EXTFH=c:extfh.cfg Can be set in Visual Studio app.config file • Set on a per file basis – INDEXCOUNT – NODESIZE – LOADONTOHEAP
  • 20. INDEXCOUNT • Specifies the number of index nodes to be cached for an index file. - Default cache size used is now 32 nodes. • Use when writing files where there are multiple keys • Use when reading files randomly • Reading files – sequentially may degrade performance • Ideal INDEXCOUNT = (Max Tree Depth * No. keys) + No. keys – Use rebuild /f - to find max tree depth [XFH-DEFAULT] [file1.dat] INDEXCOUNT=42
  • 21. INDEXCOUNT 8 million records, 5 alternate keys, resulting file 5GB Time Taken to Create File 2 alt keys 3 alt keys 4 alt keys 5 alt keys 5 min 48 secs 6 min 19 secs 6 min 29 secs 7 mins 32 secs30 min 6 secs
  • 22. NODESIZE • The NODESIZE option specifies the size of the index nodes to use for an indexed file when it is created. • NODESIZE={512|1024|4096|16384} • Use when reading records sequentially • Avoid using with INDEXCOUNT set high [XFH-DEFAULT] [file1.dat] NODESIZE=4096
  • 23. NODESIZE – Reading Records NODESIZE Sequential Access Random Access 1024 3 mins 55 secs 3 mins 09 secs 4096 3 mins 03 secs 4 mins 01 secs 16384 1 mins 59 secs 4 mins 27 secs
  • 24. LOADONTOHEAP • Forces the File Handler to load an entire file onto a memory heap • All file operations execute in memory, only writing back to disk when it is closed • Use only in exclusive mode • Use only on small files • Use with caution- Speed vs Data Integrity! [XFH-DEFAULT] [file1.dat] LOADONTOHEAP=ON
  • 25. File Handling Summary • Consider tuneables on a file-per-file basis • Think about permissions. Can you use exclusive access? • Avoid key compression if possible. • Random access – calculate the optimum INDEXCOUNT figure with rebuild /f • Sequential access – look at NODESIZE • Small exclusive files – look at LOADONTOHEAP
  • 26. • Database Drivers • OpenESQL Behavior Directive 26 Configuring OpenESQL Database Access
  • 27. • Drivers to use – ODBC = Native Code – ADO = Managed .NET – JDBC = Managed JVM • SQL Server - ODBC vs Native Client – Do NOT use old SQL Server ODBC drivers – Use SQL Server Native Client 10.0 or higher • Oracle – ADO – Use Oracle Data Provider ODP.NET – Do not use Microsoft’s Oracle Client driver 27 Database Drivers
  • 28. • SQL(BEHAVIOR=MAINFRAME) – Fastest – data access for cursors is read only for all by default – SQL Server uses firehose cursors, Oracle and DB2 use block fetches • SQL(BEHAVIOR=ANSI) – Medium Fast – data access for cursors is updateable for all by default – SQL Server uses firehose cursors, Oracle and DB2 use block fetches • SQL(BEHAVIOR=UNOPTIMIZED) – Slowest – data access for cursors is updateable for all by default – no block fetching done – compatible with older MF products • esqlconfigw utility - Set default BEHAVIOR directive for system 28 OpenESQL Behavior Directive
  • 30. • Application Structure • Program Structure • Data • Code 30 Optimizing Your Application
  • 31. • It’s important! • Execution formats • Modularity 31 Application Structure
  • 32. • INT code – Slow, portable, dynamically loaded, not shared • GNT code – Fast, dynamically loaded, not shared • Object code – OS defined format, not directly executable – Basis for native executable formats (exe, dll etc) – More efficient than .gnt • Managed code (IL, JVM) – Third party managed environment – Portable and interoperable on that framework 32 Execution Formats
  • 33. • PERFORM - very fast – Acts locally, potentially on all data – Does not take parameters • CALL - slower – Called code is external – Takes parameters – Only those parameters are affected 33 Communicating
  • 34. Demo - Execution Formats
  • 35. • Compiled for JVM – Uses JNI – Notoriously slow • Compiled for .NET – Uses Platform Invoke – Minimal overhead 36 Managed code boundary
  • 36. • Independent procedures • Logical separation of functionality • Use sections/paragraphs consistently 37 Program Structure
  • 37. • Do... – Use SECTIONs – PERFORM these sections – Use GOBACK rather than EXIT PROGRAM • Don’t... – Use PERFORM THRU or PERFORM paragraphs – Use inter-section GOTOs – Use alter, segments, OSVS or RM PERFORM-STYLE 38 In Micro Focus, the guidelines are...
  • 38. A Word on ‘In line Perform’s • Excellent structured programming technique • Keep the loop condition simple – Remember it’s tested each iteration • Avoid ‘goto’s out of the loop – Code generator optimises well structured, single exit loops – Easier to understand – Avoid problems when moving to managed code
  • 39. Data - Alignment • Memory organised into 4 or 8 byte words • Access across word boundaries is slow – At least twice as slow – Up to 50 times slower • Access across word boundaries gives larger code – Nine extra instructions for a 4 byte item on Itanium machines
  • 40. Data – Alignment Example • This comp-5 item count-a is aligned 01 grp-item. 03 count-a pic x(4) comp-5. 03 ch pic x. • This comp-5 item count-b is not aligned 01 grp2-item. 03 ch2 pic x. 03 count-b pic x(4) comp-5.
  • 41. Data – Alignment Example in Tables • The stride of a table should be a multiple of 4 – Pad the table to ensure this is true • Misaligned table item 01 tbl1 occurs 200. 03 count-a pic x(4) comp-5. 03 ref-a pic x(2) comp-5. 03 loc-a pic x comp-5. • Aligned table item 01 tbl2 occurs 200. 03 count-a pic x(4) comp-5. 03 ref-a pic x(2) comp-5. 03 loc-a pic x comp-5. 03 pic x.
  • 43. Data Types - Numerics • Optimal is 4 byte integer comp-5 – Signed or unsigned, but try not to mix in same statement • 1, 2 or 8 byte OK if required • Advantages – Smaller faster code – Required for some APIs – Quicker to generate
  • 44. Data Types – Managed • Specify managed types whenever possible – binary-long or float instead of COMP-3 or DISPLAY – Use at 01 level • no group items where possible – Use types instead of COBOL PICs • Managed code directives – ILEXPONENTIATION”FLOAT” for exponentiation speed
  • 45. Code - Arithmetic • Use operands of same type • Two operand style is always efficient – add a to b – divide c into d • Compute statement without divide operations – Split into separate COMPUTE and DIVIDE statements • Avoid using the ON SIZE error
  • 47. Your Mission... • Identification • Awareness • Resolution • Communication – http://community.microfocus.com
  • 48. Performance may feel like this...
  • 49. When it should be like this...
  • 50.
  • 51. Some Useful Checker Directives Enforce use of scope delimiters Catch subtle bugs early noimplicitscope Turn off run time checkingnocheck Improves checker speed. Catches use of identical, and confusing, paragraph names noqualproc Improves checker speed noalter noseg
  • 52. Some useful NCG Directives Specify aliasing of linkage itemslinkalias Ensure calls are linked rather than dynamically bound litlink Turn on global optimisations. Generates faster code, but takes longer to generate opt Assert that linkage items aligned Generates faster code lnkalign Turn off run time checking, including subscript, linkage and divide-by-0 checks nocheck
  • 53. @microfocus or hashtag #devcon2013 Follow us on LinkedIn or join the group Connect with your peers on the Community