Hi,
I did some trials based on some reading on millicode instructions, and please find my observations below:
Observation-1 (Compiler listing based)
Some examples of millicode instructions in z/OS High Level Assembler are MVCL and CLCL.
MVC versus MVCL
Field length is <= 256 bytes àCompiler choses MVC (Maximum that MVC can handle)
Field length is > 256 bytes àCompiler choses MVCL
Compiler uses a similar judgment for IF checks also (CLC versus CLCL), and also for the verbs like INITIALIZE (MVC versus MVCL)
WORKING-STORAGE SECTION.
01 WS-VAR1 PIC X(255) VALUE SPACE.
01 WS-VAR2 PIC X(255) VALUE SPACE.
01 WS-VAR3 PIC X(4000) VALUE SPACE.
01 WS-VAR4 PIC X(4000) VALUE SPACE.
PROCEDURE DIVISION.
MOVE WS-VAR1 TO WS-VAR2
MOVE WS-VAR3 TO WS-VAR4
===================================
000011 MOVE
000364 D2FE 8100 8000 MVC 256(255,8),0(8) WS-VAR2 ßCompiler converted this to MVC
000012 MOVE
00036A 5840 9130 L 4,304(0,9) BLW=1
00036E 4120 41A0 LA 2,416(0,4) WS-VAR4
000372 4130 0FA0 LA 3,4000(0,0)
000376 4160 8200 LA 6,512(0,8) WS-VAR3
00037A 5870 A010 L 7,16(0,10) PGMLIT AT +8
00037E 0E26 MVCL 2,6 ßCompiler converted this to MVCL
Observation-2 (Test volume based)
Note: I checked with my system admin team and they were not sure if we have the necessary firmware/hardware in place to handle millicode instructions in an optimized manner. As per my understanding, the performance of millicode instructions would be very low when the additional firmware/hardware is not in place (I think it's separately licensed).
Original:
WORKING-STORAGE SECTION.
01 WS-VAR3 PIC X(4000) VALUE SPACE.
01 WS-VAR4 PIC X(4000) VALUE SPACE.
PROCEDURE DIVISION.
PERFORM 10000000 TIMES
MOVE WS-VAR3 TO WS-VAR4
END-PERFORM
STOP RUN.
Modified:
WORKING-STORAGE SECTION.
01 WS-VAR3.
05 WS-VAR31 PIC X(256) VALUE SPACE.
05 WS-VAR32 PIC X(256) VALUE SPACE.
05 WS-VAR33 PIC X(256) VALUE SPACE.
05 WS-VAR34 PIC X(256) VALUE SPACE.
05 WS-VAR35 PIC X(256) VALUE SPACE.
05 WS-VAR36 PIC X(256) VALUE SPACE.
05 WS-VAR37 PIC X(256) VALUE SPACE.
05 WS-VAR38 PIC X(256) VALUE SPACE.
05 WS-VAR39 PIC X(256) VALUE SPACE.
05 WS-VAR310 PIC X(256) VALUE SPACE.
05 WS-VAR311 PIC X(256) VALUE SPACE.
05 WS-VAR312 PIC X(256) VALUE SPACE.
05 WS-VAR313 PIC X(256) VALUE SPACE.
05 WS-VAR314 PIC X(256) VALUE SPACE.
05 WS-VAR315 PIC X(256) VALUE SPACE.
05 WS-VAR316 PIC X(160) VALUE SPACE.
01 WS-VAR4.
05 WS-VAR41 PIC X(256) VALUE SPACE.
05 WS-VAR42 PIC X(256) VALUE SPACE.
05 WS-VAR43 PIC X(256) VALUE SPACE.
05 WS-VAR44 PIC X(256) VALUE SPACE.
05 WS-VAR45 PIC X(256) VALUE SPACE.
05 WS-VAR46 PIC X(256) VALUE SPACE.
05 WS-VAR47 PIC X(256) VALUE SPACE.
05 WS-VAR48 PIC X(256) VALUE SPACE.
05 WS-VAR49 PIC X(256) VALUE SPACE.
05 WS-VAR410 PIC X(256) VALUE SPACE.
05 WS-VAR411 PIC X(256) VALUE SPACE.
05 WS-VAR412 PIC X(256) VALUE SPACE.
05 WS-VAR413 PIC X(256) VALUE SPACE.
05 WS-VAR414 PIC X(256) VALUE SPACE.
05 WS-VAR415 PIC X(256) VALUE SPACE.
05 WS-VAR416 PIC X(160) VALUE SPACE.
PROCEDURE DIVISION.
PERFORM 10000000 TIMES
MOVE WS-VAR31 TO WS-VAR41
MOVE WS-VAR32 TO WS-VAR42
MOVE WS-VAR33 TO WS-VAR43
MOVE WS-VAR34 TO WS-VAR44
MOVE WS-VAR35 TO WS-VAR45
MOVE WS-VAR36 TO WS-VAR46
MOVE WS-VAR37 TO WS-VAR47
MOVE WS-VAR38 TO WS-VAR48
MOVE WS-VAR39 TO WS-VAR49
MOVE WS-VAR310 TO WS-VAR410
MOVE WS-VAR311 TO WS-VAR411
MOVE WS-VAR312 TO WS-VAR412
MOVE WS-VAR313 TO WS-VAR413
MOVE WS-VAR314 TO WS-VAR414
MOVE WS-VAR315 TO WS-VAR415
MOVE WS-VAR316 TO WS-VAR416
END-PERFORM
STOP RUN.
| SINGLE MOVE | | | | |
| No. of performs | TOTAL TCB CPU TIME | TOTAL ELAPSED TIME | Execution time (Mins) | % Reduction in execution time |
Original | 10000000 | 0.03 | 0 | 0.03 | |
Modified | 10000000 | 0.02 | 0 | 0.02 | 33.33 |
Original | 20000000 | 0.06 | 0 | 0.06 | |
Modified | 20000000 | 0.04 | 0 | 0.04 | 33.33 |
Original | 30000000 | 0.09 | 0 | 0.09 | |
Modified | 30000000 | 0.06 | 0 | 0.06 | 33.33 |
Original | 40000000 | 0.12 | 0.1 | 0.12 | |
Modified | 40000000 | 0.08 | 0 | 0.08 | 33.33 |
Original | 50000000 | 0.15 | 0.1 | 0.16 | |
Modified | 50000000 | 0.1 | 0 | 0.1 | 37.50 |
| 10 MOVES | | | | |
Original | 1000000 | 0.03 | 0 | 0.03 | |
Modified | 1000000 | 0.02 | 0 | 0.02 | 33.33 |
Original | 2000000 | 0.06 | 0 | 0.06 | |
Modified | 2000000 | 0.04 | 0 | 0.04 | 33.33 |
Original | 3000000 | 0.09 | 0 | 0.09 | |
Modified | 3000000 | 0.06 | 0 | 0.06 | 33.33 |
My query:
Are such millicode instructions worth looking at from the performance optimization point of view for COBOL programs? If so, how can we identify if the necessary firmware is in place or not? What are the other related considerations?
Thanks,
Anitha.
Anu2017