Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Performance on Intitialize over MOVE statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Mon Mar 26, 2007 11:59 pm    Post subject: Performance on Intitialize over MOVE statement
Reply with quote

About performance on Initialize, we demanded not to use this instruction and replace it by MOVE group of items.

But I have just tested the two solutions and I'm very surprised do find out this result :

for 1 000 000 000 iterations :

1- Initialize of a group of 40 items : 76,5 s CPU icon_biggrin.gif
2- MOVE into the same group of values identical group but with values (spaces or zeros) : 160 s CPU icon_sad.gif
3- MOVE item by item (40) : 176 s CPU icon_cry.gif

Do you confirm my result ?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 27, 2007 12:40 am    Post subject:
Reply with quote

Interesting, was OPT on?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 27, 2007 12:58 am    Post subject:
Reply with quote

Hello,

Interesting. . .

It would be informative to see what code the compiler generated for each case. My guess is that the "initialize" generated a set of data and instructions that executes using less cpu than the "single" group move - moving a group actually moves one character at a time internally and some arithmetic instructions are faster than a move. How much of the data was comp-3 or comp?

Just curious, but how long is the group field? Are there 3 programs or is this all in one program?
Back to top
View user's profile Send private message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Tue Mar 27, 2007 3:50 am    Post subject: Re: performance on Intitialize
Reply with quote

William, what is "OPT", a parameter of compiler ?

For each test I ran the same program (same loop), putting in commentary the previous code.

I also tested COMPUTE A = A -1 with ADD -1 TO A, but it was exactly the same CPU time, although I was told COMPUTE is less performant than "native" arithmetic operations.

Dick, I'll give you tomorrow the details of the group zone : there are two types of PIC : numeric comp items, 9(18), and alphanumeric items X(05) or X(10).

Now, I wonder if my sample is representative, so I'd like to have your opinion or suggestions before generalizing...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 27, 2007 3:58 am    Post subject: Re: performance on Intitialize
Reply with quote

Searchman wrote:
William, what is "OPT", a parameter of compiler?
COBOL has a compile option referred to as "Optimization", it can do some VERY strange things. Insure that OPT is off (it can be seen at the beginning of the compile listing) and run your interesting numbers again....
Back to top
View user's profile Send private message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Tue Mar 27, 2007 3:18 pm    Post subject: Re: performance on Intitialize
Reply with quote

Quote:

01 A.
05 FILLER01 PIC X(5).
05 FILLER02 PIC 9(18).
05 FILLER03 PIC 9(18).
05 FILLER04 PIC X(10).
05 FILLER05 PIC 9(18).
05 FILLER06 PIC X(5).
05 FILLER07 PIC 9(18).
05 FILLER08 PIC 9(18).
05 FILLER09 PIC X(10).
05 FILLER10 PIC 9(18).
05 FILLER11 PIC X(5).
05 FILLER12 PIC 9(18).
05 FILLER13 PIC 9(18).
05 FILLER14 PIC X(10).
05 FILLER15 PIC 9(18).
05 FILLER16 PIC X(5).
05 FILLER17 PIC 9(18).
05 FILLER18 PIC 9(18).
05 FILLER19 PIC X(10).
05 FILLER20 PIC 9(18).
05 FILLER21 PIC X(5).
05 FILLER22 PIC 9(18).
05 FILLER23 PIC 9(18).
05 FILLER24 PIC X(10).
05 FILLER25 PIC 9(18).
05 FILLER26 PIC X(5).
05 FILLER27 PIC 9(18).
05 FILLER28 PIC 9(18).
05 FILLER29 PIC X(10).
05 FILLER30 PIC 9(18).
05 FILLER31 PIC X(5).
05 FILLER32 PIC 9(18).
05 FILLER33 PIC 9(18).
05 FILLER34 PIC X(10).
05 FILLER35 PIC 9(18).
05 FILLER36 PIC X(5).
05 FILLER37 PIC 9(18).
05 FILLER38 PIC 9(18).
05 FILLER39 PIC X(10).
05 FILLER40 PIC 9(18).


the loop : "MOVE A-VALUE TO A", where A-VALUE is identical to A but with values : SPACE for X(icon_cool.gif and ZERO for 9(18) (there ara no COMP, as I said by error in my previous post)
Length of A :
24 x 9(18) = 432 bytes
8 x X(10) = 80 "
7 x X(5) = 35 "
total = 547 bytes


For the option "OPT" after compiling, I found this in the sysout :
I guess the option OPT is active...

[/quote]
1PP 5668-958 IBM VS COBOL II Release 4.0 09/15/92
0Invocation parameters:
NOEXIT,LANGUAGE(EN)
0PROCESS(CBL) statements:
CBL ADV,APOST,NOAWO,BUFSIZE(4096),NOCMPR2,NOCOMPILE(S),DATA(24)
CBL NODBCS,NODECK,NODUMP,DYNAM,NOFASTSRT,NOFDUMP,FLAG(I)
CBL NOFLAGMIG,NOFLAGSAA,NOFLAGSTD,LIB,LINECOUNT(60),NOLIST,MAP
CBL NONAME,NONUMBER,NUMPROC(NOPFD),OBJECT,OPTIMIZE,OUTDD(SYSOUT)
CBL RENT,RESIDENT,NOSEQUENCE,SIZE(MAX),SOURCE,SPACE(1),NOSSRANGE
CBL NOTERM,NOTEST,TRUNC(OPT),NOVBREF,NOWORD,XREF(FULL),ZWB,LIST
0Options in effect:
ADV
APOST
NOAWO
BUFSIZE(4096)
NOCMPR2
NOCOMPILE(S)
DATA(24)
NODBCS
NODECK
NODUMP
DYNAM
NOEXIT
NOFASTSRT
NOFDUMP
FLAG(I)
NOFLAGMIG
NOFLAGSAA
NOFLAGSTD
LANGUAGE(EN)
LIB
LINECOUNT(60)
LIST
MAP
NONAME
NONUMBER
NUMPROC(NOPFD)
OBJECT
NOOFFSET
OPTIMIZE
OUTDD(SYSOUT)
RENT
RESIDENT
NOSEQUENCE
SIZE(MAX)
SOURCE
SPACE(1)
NOSSRANGE
NOTERM
NOTEST
TRUNC(OPT)
NOVBREF
NOWORD
XREF(FULL)
ZWB
Quote:
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2007 3:21 am    Post subject:
Reply with quote

Hello,

I would still be interested to see what assembler code was generated for each case.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Mar 30, 2007 3:42 am    Post subject:
Reply with quote

Yes Dick, I've been a bit busy, but I'm planning to get some PMAPs too.
I have seen OPT do some really radical things....Works a whole heck of a lot better than the old days...grin....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2007 4:53 am    Post subject:
Reply with quote

Hi Bill,

I was hoping to see the assembler that was run to generate the posted stats. . .

If you have the resources, it would also be interesting to see the same test done on a second system.

Not sure if i can try this over the weekend or not just yet. The schedule here is quite demand driven icon_rolleyes.gif
Back to top
View user's profile Send private message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Fri Mar 30, 2007 10:06 pm    Post subject:
Reply with quote

Sorry, but I can't run again my first tests, so my conclusion is that I was wrong.

In fact the result is (I hope this time !) :

for 1 000 000 000 iterations and group to initialize = 10 items = 168 bytes

Initialize :
23 s CPU
MOVE item group :
6 s CPU
MOVE item by item
23 s CPU

Note, for 90 items in the item group I found out respectively :
211, 103 and 205 s CPU

Conclusion :
For 10 items = 134 bytes
Initialize is 3.8 times lower than MOVE item group
For 90 items = 1186 bytes
Initialize is 2 times lower than MOVE item group

The more the item group is large the more the initialize is "performant", but even with 1186 bytes, Initialize has bad performance (2 times less fast)

Other conclusion :
coste of 1 MOVE = betwwen 2,3 and 2,56 nano second !

[/b]
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2007 10:19 pm    Post subject:
Reply with quote

Hello,

Your new stats look like what i'd expect (not the actual count, but the ratio). The initialize should generate a series of moves much like the ones coded individually.

Thanks for showing your tests and posting the new results icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts CONTIG for performance? JPVRoff JCL & VSAM 8 Fri Jun 09, 2017 8:39 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us